Code: Select all
from numba import njit
@njit
def main_with_njit():
a = 94906267
print(f'main_with_njit: a**2 = {a ** 2}') # -> a**2 = 9007199515875288
# the type is int64
main_with_njit()
def main_without_njit():
a = 94906267
print(f'main_without_njit: a**2 = {a ** 2}') # -> a**2 = 9007199515875289
# the type is
main_without_njit()
Ich verwende Python 3.11.3 mit PyCharm 2023.1.2 (Community Edition) unter Windows, 64 Bit, 0.61.0-Version von numba.
Ich habe das Problem reproduziert 0.63.1 Version von numba.
Ich kann das ursprünglich von @Roshan N beschriebene Problem mithilfe der Math-Bibliothek reproduzieren.
Code: Select all
import math
print(math.pow(94906267, 2)) # -> 9007199515875288.0
Mobile version