Plutus provides arithmetic functions for Integers through the modules PlutusTx.Prelude and PlutusTx.Builtins. Are there floating-point arithmetic functions which can be used on chain? If not, why is it so?


My opinion would be that:

Floating point operations are typically resource-consuming and expensive to compute.

I mean, even 1 ADA had to be made a million Lovelace in order for the possibility to have fractional amount of ADA.

I'd suggest you follow the same approach

  • Let the onchain code deal with Integer and carry-out floating point operations off-chain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.