Skip to content
  • mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar
    Numeric tower repairs on promoting floats across representation boundaries. · 56638363
    Thanks to Massimiliano Ghilardi.
    
    If a bignum exceeds the largest representable single-float,
    EQUALP will raise a type-error when comparing it to a single-float.
    The same problem happens with double-floats.
    
    I am reporting this because my understanding of CLHS
    http://www.lispworks.com/documentation/lw51/CLHS/Body/f_equalp.htm#equalp
    tells that EQUALP is not supposed to raise errors at all:
    "Exceptional Situations: None."
    
    How to reproduce:
    
    ;; =========== double-floats ===========
    (= (ash 1 1024) most-positive-double-float)
    NIL
    
    (equalp (ash 1 1024) most-positive-double-float)
    ; Evaluation aborted on #<TYPE-ERROR {215F90FE}>.
    
    
    ;; =========== single-floats ===========
    (= 340282360000000000000000000000000000000 0.0f0)
    NIL
    
    (equalp 340282360000000000000000000000000000000 0.0f0)
    ; Evaluation aborted on #<TYPE-ERROR {1CFFC364}>.
    56638363