Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sage/rings/integer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7755,9 +7755,9 @@ cdef double mpz_get_d_nearest(mpz_t x) except? -648555075988944.5:
# Check for overflow
if sx > 1024:
if resultsign < 0:
return -1.0/0.0
return float('-inf')
else:
return 1.0/0.0
return float('inf')

# General case

Expand Down
4 changes: 2 additions & 2 deletions src/sage/rings/rational.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3993,9 +3993,9 @@ cdef double mpq_get_d_nearest(mpq_t x) except? -648555075988944.5:
return 0.0
elif shift >= 971: # |d| > 2^1024
if resultsign < 0:
return -1.0/0.0
return float('-inf')
else:
return 1.0/0.0
return float('inf')

sig_on()

Expand Down