Skip to content

Latest commit

 

History

History
1 lines (1 loc) · 523 Bytes

Precision_Loss_in_Calculations.md

File metadata and controls

1 lines (1 loc) · 523 Bytes

Smart contracts are high-level programs that are translated into EVM byte code and then deployed to the Ethereum blockchain for execution. Solidity mathematic procedures are similar to other programming languages. The following arithmetic operations are applicable to Solidity: Addition, Subtraction, Multiplication, Division (x / y), Modulus (x% y), Exponential (x**y) In the case of performing Integer division, Solidity may truncate the result. Hence we must multiply before dividing to prevent such loss in precision