isEqual
Whether a
is equal to b
.
function isEqual(FPUnsigned a, FPUnsigned b) internal pure returns (bool)
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned. |
b | FPUnsigned | b FPUnsigned. |
Return Values
Name | Type | Description |
---|
[0] | bool | True if equal, or False. |
isNotEqual
Whether a
is equal to b
.
function isNotEqual(FPUnsigned a, FPUnsigned b) internal pure returns (bool)
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned. |
b | FPUnsigned | b FPUnsigned. |
Return Values
Name | Type | Description |
---|
[0] | bool | True if equal, or False. |
isGreaterThan
Whether a
is greater than b
.
function isGreaterThan(FPUnsigned a, FPUnsigned b) internal pure returns (bool)
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned. |
b | FPUnsigned | b FPUnsigned. |
Return Values
Name | Type | Description |
---|
[0] | bool | True if a > b , or False. |
isGreaterThanOrEqual
Whether a
is greater than or equal to b
.
function isGreaterThanOrEqual(FPUnsigned a, FPUnsigned b) internal pure returns (bool)
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned. |
b | FPUnsigned | b FPUnsigned. |
Return Values
Name | Type | Description |
---|
[0] | bool | True if a >= b , or False. |
isLessThan
Whether a
is less than b
.
function isLessThan(FPUnsigned a, FPUnsigned b) internal pure returns (bool)
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned. |
b | FPUnsigned | b FPUnsigned. |
Return Values
Name | Type | Description |
---|
[0] | bool | True if a < b , or False. |
isLessThanOrEqual
Whether a
is less than or equal to b
.
function isLessThanOrEqual(FPUnsigned a, FPUnsigned b) internal pure returns (bool)
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned. |
b | FPUnsigned | b FPUnsigned. |
Return Values
Name | Type | Description |
---|
[0] | bool | True if a <= b |
add
Adds two FPUnsigned
s, reverting on overflow.
function add(FPUnsigned a, FPUnsigned b) internal pure returns (FPUnsigned)
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned. |
b | FPUnsigned | b FPUnsigned. |
Return Values
Name | Type | Description |
---|
[0] | FPUnsigned | the sum of a and b . |
sub
Subtracts two FPUnsigned
s, reverting on overflow.
function sub(FPUnsigned a, FPUnsigned b) internal pure returns (FPUnsigned)
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned. |
b | FPUnsigned | b FPUnsigned. |
Return Values
Name | Type | Description |
---|
[0] | FPUnsigned | the difference of a and b . |
mul
Multiplies two FPUnsigned
s, reverting on overflow.
function mul(FPUnsigned a, FPUnsigned b) internal pure returns (FPUnsigned)
This will "floor" the product.
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned. |
b | FPUnsigned | b FPUnsigned. |
Return Values
Name | Type | Description |
---|
[0] | FPUnsigned | the product of a and b . |
div
Divides one FPUnsigned
by an FPUnsigned
, reverting on overflow or division by 0.
function div(FPUnsigned a, FPUnsigned b) internal pure returns (FPUnsigned)
This will "floor" the quotient.
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned numerator. |
b | FPUnsigned | a FPUnsigned denominator. |
Return Values
Name | Type | Description |
---|
[0] | FPUnsigned | the quotient of a divided by b . |
divCeil
Divides one FPUnsigned
by an FPUnsigned
, reverting on overflow or division by 0.
function divCeil(FPUnsigned a, FPUnsigned b) internal pure returns (FPUnsigned)
This will ceil the quotient.
Parameters
Name | Type | Description |
---|
a | FPUnsigned | a FPUnsigned numerator. |
b | FPUnsigned | a FPUnsigned denominator. |
Return Values
Name | Type | Description |
---|
[0] | FPUnsigned | the quotient of a divided by b . |
roundUp
Convert a FPUnsigned.FPUnsigned to uint, rounding up any decimal portion.
function roundUp(FPUnsigned value) internal pure returns (uint256)
trunc
Convert a FPUnsigned.FPUnsigned to uint, "truncating" any decimal portion.
function trunc(FPUnsigned value) internal pure returns (uint256)
floor
Round a FPUnsigned.Unsigned down to the nearest integer.
function floor(FPUnsigned value) internal pure returns (FPUnsigned)
ceil
Round a FPUnsigned.Unsigned up to the nearest integer.
function ceil(FPUnsigned value) internal pure returns (FPUnsigned)
neg
Negate a FPUnsigned
function neg(FPUnsigned a) internal pure returns (FPSigned)
Parameters
Name | Type | Description |
---|
a | FPUnsigned | Value to negate |
Return Values
Name | Type | Description |
---|
[0] | FPSigned | FPSigned a * -1 |