Float trapped explicitly: losing precision

Float.div(Float.fromInt(4999999999999999890753), Float.fromInt(Int.pow(10, 8)));

Call was rejected:
Request ID: 81f4f619948b3a19e47d912a644f8772e60decc32ea9179f622f3cb22c56e735
Reject code: 
Reject text: Canister 3c7jb-myaaa-aaaab-qacoa-cai trapped explicitly: losing precision

Float
type Float = Prim.Types.Float
64-bit floating point numbers.

Is float only 64 bit enough for business?

This smells like Issues · dfinity/motoko-base · GitHub maybe that fix has not yet reached you

2 Likes

There is no error when using the latest SDK