Skip to content

floor, ceiling, truncate and so on… on NaN fail

Those functions returns a total random value when given NaN. This is not an acceptable behavior I guess, and we might inquire on what to do.

For instance:

let nan = 0 / 0 in floor nan

result:

-269653970229347386159395778618353710042696546841345985910145121736599013708251444699062715983611304031680170819807090036488184653221624933739271145959211186566651840137298227914453329401869141179179624428127508653257226023513694322210869665811240855745025766026879447359920868907719574457253034494436336205824

Maybe an arithmetic exception would be a better behavior?

Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority high
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