Contents
Numerical value trait
Parameters
| type | A | The type for which the number operations are defined. |
Methods
Find the absolute value of a number
Parameters
| param | x | The value to find the absolute value of |
| returns | The non-negative absolute value of x | |
method A Signum (A x) Source #
Find the sign of x
Parameters
| param | x | The value to find the sign of |
| returns | -1, 0, or +1 | |
method A FromInteger (int x) Source #
Generate a numeric value from an integer
Parameters
| param | x | The integer to use |
| returns | The equivalent of x in the Num〈A〉 | |
method A FromDecimal (decimal x) Source #
Generate a numeric value from a decimal
Parameters
| param | x | The decimal to use |
| returns | The equivalent of x in the Num〈A〉 | |
method A FromFloat (float x) Source #
Generate a numeric value from a float
Parameters
| param | x | The float to use |
| returns | The equivalent of x in the Num〈A〉 | |
method A FromDouble (double x) Source #
Generate a numeric value from a double
Parameters
| param | x | The double to use |
| returns | The equivalent of x in the Num〈A〉 | |
Methods
method A divide <NUM, A> (A x, A y) Source #
Divide two numbers
Parameters
| param | x | left hand side of the division operation |
| param | y | right hand side of the division operation |
| returns | x / y | |
method A abs <NUM, A> (A x) Source #
Find the absolute value of a number
Parameters
| param | x | The value to find the absolute value of |
| returns | The non-negative absolute value of x | |
method A signum <NUM, A> (A x) Source #
Find the sign of x
Parameters
| param | x | The value to find the sign of |
| returns | -1, 0, or +1 | |
method A fromInteger <NUM, A> (int x) Source #
Generate a numeric value from an integer
Parameters
| param | x | The integer to use |
| returns | The equivalent of x in the Num〈A〉 | |
method A fromDecimal <NUM, A> (decimal x) Source #
Generate a numeric value from a float
Parameters
| param | x | The float to use |
| returns | The equivalent of x in the Num〈A〉 | |
method A fromFloat <NUM, A> (float x) Source #
Generate a numeric value from a double
Parameters
| param | x | The double to use |
| returns | The equivalent of x in the Num〈A〉 | |
method A fromDouble <NUM, A> (double x) Source #
Generate a numeric value from a decimal
Parameters
| param | x | The decimal to use |
| returns | The equivalent of x in the Num〈A〉 | |