user871: 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?

user255: 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.


871: <p>Plutus provides arithmetic functions for Integers through the modules <code>PlutusTx.Prelude</code> and <code>PlutusTx.Builtins</code>. Are there floating-point arithmetic functions which can be used on chain? If not, why is it so?</p>
 255: <p>My opinion would be that:</p>
<p>Floating point operations are typically resource-consuming and expensive to compute.</p>
<p>I mean, even 1 ADA had to be made a million Lovelace in order for the possibility to have fractional amount of ADA.</p>
<p>I'd suggest you follow the same approach</p>
<ul>
<li>Let the onchain code deal with Integer and carry-out floating point operations off-chain.</li>
</ul>
