DEV Community

Cover image for ◼️28/100 Block-by-Block: Why there are no floats in Solidity
András Novoszáth
András Novoszáth

Posted on

◼️28/100 Block-by-Block: Why there are no floats in Solidity

One thing I learned about: Why there are no floats in Solidity.

  • Nodes must agree on transaction results.
  • Transaction results must be deterministic.
  • Different systems calculate floats in different ways. (e.g. 2/3 can be 0.66666 or 0.66667)

"In Solidity, division rounds towards zero."

🔽🛠️Resources🔽

Top comments (0)