Skip to content

Latest commit

 

History

History
99 lines (72 loc) · 2.07 KB

SafeMath.md

File metadata and controls

99 lines (72 loc) · 2.07 KB

SafeMath (SafeMath.sol)

View Source: openzeppelin-solidity/contracts/math/SafeMath.sol

SafeMath

Math operations with safety checks that throw on error

Functions

mul

Multiplies two numbers, throws on overflow.

function mul(uint256 _a, uint256 _b) internal pure
returns(c uint256)

Arguments

Name Type Description
_a uint256
_b uint256

div

Integer division of two numbers, truncating the quotient.

function div(uint256 _a, uint256 _b) internal pure
returns(uint256)

Arguments

Name Type Description
_a uint256
_b uint256

sub

Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).

function sub(uint256 _a, uint256 _b) internal pure
returns(uint256)

Arguments

Name Type Description
_a uint256
_b uint256

add

Adds two numbers, throws on overflow.

function add(uint256 _a, uint256 _b) internal pure
returns(c uint256)

Arguments

Name Type Description
_a uint256
_b uint256

Contracts