You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A complex number's exact parts become decimals past 10^50, so exp(10^84 i) and cos(10^84 + i) are NaN #2685
On master (0b1b7d7), a complex number whose parts are exact stops being exact once a part passes about 10^50. A later operation on it is then treated as an operation on a decimal, and #2674's cut-off for inexact arguments past 10^(precision - 16) makes it NaN. Reference values are from mpmath at 300 digits.
.Evaled
master
true value
(10^40 + 1/3 + i) - 10^40
1/3 + i
same (correct)
(10^50 + 1/3 + i) - 10^50
0.3333333333333333… + i
1/3 + i
(10^60 + 1/3) - 10^60
1/3
same (correct)
(10^60 + i) * (10^60 - i)
1.000…000E+120 (100 digits)
10^120 + 1
cos(10^84)
0.7550644793108826…
same (correct)
exp(10^80 * i)
-0.9983975062334704… - 0.0565899244281819…i
same (correct)
exp(10^84 * i)
NaN
0.755064479310883 + 0.655650541129179i
cos(10^84 + i)
NaN
1.16512537606148 - 0.770521298548216i
Ci(10^100 + i)
NaN
-5.74606385289283E-101 - 1.09068296264295E-100i
The real cases keep exact rationals, so cos(10^84) has a value. The complex ones go through EDecimal, which #2684 found in OpSum. Keeping an exact rational part exact through complex arithmetic would let every row above be computed. The NaN for a genuinely inexact argument past the working digits, from #2674, is right and should stay.
Activity