Why are there no decimal numbers in Solidity?

Viewed 171

I know that there are no floats/doubles in Solidity but I am wondering why? I've googled it and all I can find are questions about how to deal with this lack.

3 Answers

I think the reason behind is floating-point operations calculated by various functions can produce different results in different runtime environments. Ethereum blockchain is deterministic which ensures that smart contracts always produce the same output for the same input.

Also for large size of transactions, a very little difference in rounding floating numbers will cause a big difference in finance

Related