Skip to content

Unnecessary overflow in encodeFloat

Prelude> encodeFloat (2^1024) (-1024)
Infinity

The real result is 1.0 of course.

The docs for encodeFloat now say that the result is infinite if overflow occurs, so technically we're within the spec, but I think in this case it shouldn't overflow.

Trac metadata
Trac field Value
Version 7.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information