Skip to content

Latest commit

 

History

History
20 lines (19 loc) · 675 Bytes

Divide before multiply.md

File metadata and controls

20 lines (19 loc) · 675 Bytes

Performing multiplication before division is generally better to avoid loss of precision because Solidity integer division might truncate. (see here)


Slide Screenshot

020.jpg


Slide Text

  • Integer Arithmetic
  • Divide Before Multiply
  • Solidity Integer Division
  • Truncation
  • Division -> Multiplication
  • Loss of precision
  • Multiplication -> Division

References


Tags