Skip to content

Latest commit

 

History

History
90 lines (55 loc) · 1.44 KB

SafeMath.md

File metadata and controls

90 lines (55 loc) · 1.44 KB

SafeMath

function add

SafeMath.add(a, b) pure 771602f7

Adds two numbers, throws on overflow.

Inputs

type name description
uint256 a First addend
uint256 b Second addend

Outputs

type name description
uint256 result Returns summation

function div

SafeMath.div(a, b) pure a391c15b

Integer division of two numbers, truncating the quotient.

Inputs

type name description
uint256 a Dividend
uint256 b Divisor

Outputs

type name description
uint256 result Returns quotient

function sub

SafeMath.sub(a, b) pure b67d77c5

Subtracts two numbers, throws on underflow.

Inputs

type name description
uint256 a Subtrahend
uint256 b Minuend

Outputs

type name description
uint256 result Returns difference

function mul

SafeMath.mul(a, b) pure c8a4ac9c

Multiplies two numbers, throws on overflow.

Inputs

type name description
uint256 a Multiplier
uint256 b Multiplicand

Outputs

type name description
uint256 result Returns product