Open leo-web3 opened 2 years ago
This smells like https://github.com/dfinity/motoko-base/issues/272; maybe that fix has not yet reached you
An older version of Motoko converted Int
s to Float
s via Int64
, which indeed caused problems. Please make sure that you have the most recent dfx
.
I used Motoko Playground to test whether Motoko Playground also uses the old version of the SDK
Motoko playground's default base library is only at dfx 0.8.0, which is the latest tag on motoko-base repo. To get base from master, you can click "Add" button at the "Packages" section and reimport "base". Your example works after the reimport.
Float.div(Float.fromInt(4999999999999999890753), Float.fromInt(Int.pow(10, 8)));
Is float only 64 bit enough for business?
Float trapped explicitly: losing #precision