Skip to main content

Decimal

Functions

zero

function zero() internal returns (struct Decimal.D256)

one

function one() internal returns (struct Decimal.D256)

from

function from(
uint256 a
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
auint256

ratio

function ratio(
uint256 a,
uint256 b
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
auint256
buint256

add

function add(
struct Decimal.D256 self,
uint256 b
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
buint256

sub

function sub(
struct Decimal.D256 self,
uint256 b
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
buint256

sub

function sub(
struct Decimal.D256 self,
uint256 b,
string reason
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
buint256
reasonstring

mul

function mul(
struct Decimal.D256 self,
uint256 b
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
buint256

div

function div(
struct Decimal.D256 self,
uint256 b
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
buint256

pow

function pow(
struct Decimal.D256 self,
uint256 b
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
buint256

add

function add(
struct Decimal.D256 self,
struct Decimal.D256 b
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
bstruct Decimal.D256

sub

function sub(
struct Decimal.D256 self,
struct Decimal.D256 b
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
bstruct Decimal.D256

sub

function sub(
struct Decimal.D256 self,
struct Decimal.D256 b,
string reason
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
bstruct Decimal.D256
reasonstring

mul

function mul(
struct Decimal.D256 self,
struct Decimal.D256 b
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
bstruct Decimal.D256

div

function div(
struct Decimal.D256 self,
struct Decimal.D256 b
) internal returns (struct Decimal.D256)

Parameters

NameTypeDescription
selfstruct Decimal.D256
bstruct Decimal.D256

equals

function equals(
struct Decimal.D256 self,
struct Decimal.D256 b
) internal returns (bool)

Parameters

NameTypeDescription
selfstruct Decimal.D256
bstruct Decimal.D256

greaterThan

function greaterThan(
struct Decimal.D256 self,
struct Decimal.D256 b
) internal returns (bool)

Parameters

NameTypeDescription
selfstruct Decimal.D256
bstruct Decimal.D256

lessThan

function lessThan(
struct Decimal.D256 self,
struct Decimal.D256 b
) internal returns (bool)

Parameters

NameTypeDescription
selfstruct Decimal.D256
bstruct Decimal.D256

greaterThanOrEqualTo

function greaterThanOrEqualTo(
struct Decimal.D256 self,
struct Decimal.D256 b
) internal returns (bool)

Parameters

NameTypeDescription
selfstruct Decimal.D256
bstruct Decimal.D256

lessThanOrEqualTo

function lessThanOrEqualTo(
struct Decimal.D256 self,
struct Decimal.D256 b
) internal returns (bool)

Parameters

NameTypeDescription
selfstruct Decimal.D256
bstruct Decimal.D256

isZero

function isZero(
struct Decimal.D256 self
) internal returns (bool)

Parameters

NameTypeDescription
selfstruct Decimal.D256

asUint256

function asUint256(
struct Decimal.D256 self
) internal returns (uint256)

Parameters

NameTypeDescription
selfstruct Decimal.D256

getPartial

function getPartial(
uint256 target,
uint256 numerator,
uint256 denominator
) private returns (uint256)

Parameters

NameTypeDescription
targetuint256
numeratoruint256
denominatoruint256

compareTo

function compareTo(
struct Decimal.D256 a,
struct Decimal.D256 b
) private returns (uint256)

Parameters

NameTypeDescription
astruct Decimal.D256
bstruct Decimal.D256