Menu

#3777 rat fails on denormalized floats

None
closed
nobody
5
3 days ago
2021-04-27
No

Calling rat(1.0e-320) gives the error arithmetic error FLOATING-POINT-OVERFLOW signalled
The problem is that (/ 1.0 1.0e-320) overflows in maxima-rationalize / ration1 (rat3e).

To avoid this pointless and silly error, use rationalize internally. This does not produce a minimal denominator as rat does, but produces a correct result. If the user needs the minimal denominator, they can use rat(bfloat(...)).

Discussion

  • Robert Dodier

    Robert Dodier - 2021-04-27
    • labels: --> rat, floating point
     
  • Stavros Macrakis

    Fixed in 5.49.0 SBCL 2.5.1. Does it still fail in other Lisps?

     
  • David Scherfgen

    David Scherfgen - 3 days ago
    • status: open --> closed
     
  • David Scherfgen

    David Scherfgen - 3 days ago

    Works on GCL, CCL, ABCL, too. But CLISP gives 0 for rat(1.0e-320). I'd call it fixed, since CLISP is effectively dead and broken on modern Windows.

     

Log in to post a comment.