3

so lets say result of a calculation in solidity is 0.2 or 0.8, when I save that result in a variable does that convert to 0 or 1 ?

1 Answer 1

3

Solidity truncates all results, it's equivalent to the floor operation. So if your contract tries to store the result of 9 / 5 in a uint it will simply store 1

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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