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

a

uint256

ratio

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

Parameters

NameTypeDescription

a

uint256

b

uint256

add

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

uint256

sub

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

uint256

sub

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

uint256

reason

string

mul

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

uint256

div

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

uint256

pow

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

uint256

add

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

struct Decimal.D256

sub

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

struct Decimal.D256

sub

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

struct Decimal.D256

reason

string

mul

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

struct Decimal.D256

div

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

struct Decimal.D256

equals

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

struct Decimal.D256

greaterThan

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

struct Decimal.D256

lessThan

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

struct Decimal.D256

greaterThanOrEqualTo

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

struct Decimal.D256

lessThanOrEqualTo

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

Parameters

NameTypeDescription

self

struct Decimal.D256

b

struct Decimal.D256

isZero

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

Parameters

NameTypeDescription

self

struct Decimal.D256

asUint256

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

Parameters

NameTypeDescription

self

struct Decimal.D256

getPartial

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

Parameters

NameTypeDescription

target

uint256

numerator

uint256

denominator

uint256

compareTo

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

Parameters

NameTypeDescription

a

struct Decimal.D256

b

struct Decimal.D256

Last updated