We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b3f398 commit 900fbc5Copy full SHA for 900fbc5
src/sage/rings/integer.pyx
@@ -7755,9 +7755,9 @@ cdef double mpz_get_d_nearest(mpz_t x) except? -648555075988944.5:
7755
# Check for overflow
7756
if sx > 1024:
7757
if resultsign < 0:
7758
- return -1.0/0.0
+ return float('-inf')
7759
else:
7760
- return 1.0/0.0
+ return float('inf')
7761
7762
# General case
7763
src/sage/rings/rational.pyx
@@ -3993,9 +3993,9 @@ cdef double mpq_get_d_nearest(mpq_t x) except? -648555075988944.5:
3993
return 0.0
3994
elif shift >= 971: # |d| > 2^1024
3995
3996
3997
3998
3999
4000
sig_on()
4001
0 commit comments