ballerina.math package
public function IEEEremainder ( float a , float b ) ( float )
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard
Parameter Name | Data Type | Description |
---|---|---|
a | float | The dividend |
b | float | The divisor |
public function absFloat ( float val ) ( float )
Returns the absolute value of a float value
Parameter Name | Data Type | Description |
---|---|---|
val | float | Value to get absolute value |
public function absInt ( int val ) ( int )
Returns the absolute value of an int value
Parameter Name | Data Type | Description |
---|---|---|
val | int | Value to get the absolute value |
public function acos ( float val ) ( float )
Returns the arc cosine of a value; the returned angle is in the range 0.0 through pi
Parameter Name | Data Type | Description |
---|---|---|
val | float | Value to get the arc cosine |
public function asin ( float val ) ( float )
Returns the arc sine of a value
Parameter Name | Data Type | Description |
---|---|---|
val | float | Value to get the arc sine |
public function atan ( float val ) ( float )
Returns the arc tangent of a value
Parameter Name | Data Type | Description |
---|---|---|
val | float | Value to get the arc tangent |
public function atan2 ( float a , float b ) ( float )
Returns the angle theta from the conversion of rectangular coordinates (a, b) to polar coordinates (r, theta)
Parameter Name | Data Type | Description |
---|---|---|
a | float | The ordinate coordinate |
b | float | The abscissa coordinate |
public function cbrt ( float val ) ( float )
Returns the cube root of a float value
Parameter Name | Data Type | Description |
---|---|---|
val | float | Value to get the cube root |
public function ceil ( float val ) ( float )
Returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer
Parameter Name | Data Type | Description |
---|---|---|
val | float | Value to get the ceil |
public function copySign ( float a , float b ) ( float )
Returns the first floating-point argument with the sign of the second floating-point argument
Parameter Name | Data Type | Description |
---|---|---|
a | float | |
b | float |
public function cos ( float val ) ( float )
Returns the trigonometric cosine of an angle
Parameter Name | Data Type | Description |
---|---|---|
val | float | Value to get the trigonometric cosine |
public function cosh ( float val ) ( float )
Returns the hyperbolic cosine of a float value
Parameter Name | Data Type | Description |
---|---|---|
val | float | The number whose hyperbolic cosine is to be returned |
public function exp ( float val ) ( float )
Returns Euler's number, that is 'e' raised to the power of exponent
Parameter Name | Data Type | Description |
---|---|---|
val | float | Exponent value to raise |
public function expm1 ( float val ) ( float )
Returns (e to the power of x) -1
Parameter Name | Data Type | Description |
---|---|---|
val | float | The exponent to raise e to in the computation |
public function floor ( float val ) ( float )
Returns the largest (closest to positive infinity) float value that is less than or equal to the argument and is equal to a mathematical integer
Parameter Name | Data Type | Description |
---|---|---|
val | float | A float value |
public function floorDiv ( int a , int b ) ( int )
Returns the largest (closest to positive infinity) int value that is less than or equal to the algebraic quotient
Parameter Name | Data Type | Description |
---|---|---|
a | int | The dividend |
b | int | The divisor |
public function floorMod ( int a , int b ) ( int )
Returns the floor modulus of the long arguments
Parameter Name | Data Type | Description |
---|---|---|
a | int | The dividend |
b | int | The divisor |
public function getExponent ( float val ) ( int )
Returns the unbiased exponent used in the representation of a float
Parameter Name | Data Type | Description |
---|---|---|
val | float | Float value |
public function hypot ( float a , float b ) ( float )
Returns sqrt(a squared +b squared) without intermediate overflow or underflow
Parameter Name | Data Type | Description |
---|---|---|
a | float | Float value |
b | float | Float value |
public function log ( float val ) ( float )
Returns the natural logarithm (base e) of a float value
Parameter Name | Data Type | Description |
---|---|---|
val | float | A float value |
public function log10 ( float val ) ( float )
Returns the base 10 logarithm of a float value
Parameter Name | Data Type | Description |
---|---|---|
val | float | A float value |
public function log1p ( float val ) ( float )
Returns the natural logarithm of the sum of the argument and 1
Parameter Name | Data Type | Description |
---|---|---|
val | float | A float value |
public function negateExact ( int val ) ( int )
Returns the negation of the argument
Parameter Name | Data Type | Description |
---|---|---|
val | int | The value to negate |
public function nextAfter ( float a , float b ) ( float )
Returns the floating-point number adjacent to the first argument in the direction of the second argument
Parameter Name | Data Type | Description |
---|---|---|
a | float | Starting floating-point value |
b | float | Value indicating which of start's neighbors or start should be returned |
public function nextDown ( float val ) ( float )
Returns the adjacent floating-point value closer to negative infinity
Parameter Name | Data Type | Description |
---|---|---|
val | float | Starting floating-point value |
public function nextUp ( float val ) ( float )
Returns the adjacent floating-point value closer to positive infinity
Parameter Name | Data Type | Description |
---|---|---|
val | float | Starting floating-point value |
public function pow ( float a , float b ) ( float )
Returns the value of the 'a' raised to the power of 'b'
Parameter Name | Data Type | Description |
---|---|---|
a | float | The base value |
b | float | The exponent value |
public function random ( ) ( float )
Returns a random number between 0.0 and 1.0
public function randomInRange ( int start , int end ) ( int )
Returns a random number between given start(inclusive) and end(exclusive) values
Parameter Name | Data Type | Description |
---|---|---|
start | int | Range start value |
end | int | Range end value |
public function rint ( float val ) ( float )
Returns the double value that is closest in value to the argument and is equal to a mathematical integer
Parameter Name | Data Type | Description |
---|---|---|
val | float | A float value |
public function round ( float val ) ( int )
Returns the closest int to the argument, with ties rounding to positive infinity
Parameter Name | Data Type | Description |
---|---|---|
val | float | A floating-point value to be rounded to an integer |
public function scalb ( float a , int b ) ( float )
Returns a × (2 to the power of scaleFactor) rounded as if performed by a single correctly rounded floating-point multiply to a member of the float value set
Parameter Name | Data Type | Description |
---|---|---|
a | float | Number to be scaled by a power of two |
b | int |
public function signum ( float val ) ( float )
Returns the signum function of the argument
Parameter Name | Data Type | Description |
---|---|---|
val | float | The floating-point value whose signum is to be returned |
public function sin ( float val ) ( float )
Returns the trigonometric sine of an angle
Parameter Name | Data Type | Description |
---|---|---|
val | float | An angle, in radians |
public function sinh ( float val ) ( float )
Returns the hyperbolic sine of a float value
Parameter Name | Data Type | Description |
---|---|---|
val | float | The number whose hyperbolic sine is to be returned |
public function sqrt ( float val ) ( float )
Returns rounded positive square root of the given value
Parameter Name | Data Type | Description |
---|---|---|
val | float | Value to get square root |
public function tan ( float val ) ( float )
Returns the trigonometric tangent of an angle
Parameter Name | Data Type | Description |
---|---|---|
val | float | An angle, in radians |
public function tanh ( float val ) ( float )
Returns the hyperbolic tangent of a double value
Parameter Name | Data Type | Description |
---|---|---|
val | float | The number whose hyperbolic tangent is to be returned |
public function toDegrees ( float val ) ( float )
Converts an angle measured in radians to an approximately equivalent angle measured in degrees
Parameter Name | Data Type | Description |
---|---|---|
val | float | An angle, in radians |
public function toRadians ( float val ) ( float )
Converts an angle measured in degrees to an approximately equivalent angle measured in radians
Parameter Name | Data Type | Description |
---|---|---|
val | float | An angle, in degrees |
public function ulp ( float val ) ( float )
Returns the size of an ulp of the argument
Parameter Name | Data Type | Description |
---|---|---|
val | float | The floating-point value whose ulp is to be returned |
PI
Attribute Name | Data Type | Description |
---|---|---|
PI | float | The ratio of the circumference of a circle to its diameter |
E
Attribute Name | Data Type | Description |
---|---|---|
E | float | The base of the natural logarithms |