Constants and functions supporting the `Float` type defined in `ceylon.language`.

See also `Float`
 Values `e` Source Code`shared Float e= 2.7182818284590452354`The `Float` which best approximates the mathematical constant 𝑒, the base of the natural logarithm. See also `pi` Source Code`shared Float pi= 3.14159265358979323846`The Float which best approximates the mathematical constant π, the ratio of the circumference of a circle to its diameter.
Functions
`acos`Source Code`shared Float acos(Float num)`

The arc cosine of the given number.

• `acos(x)` for any x < -1 is `undefined`,
• `acos(x)` for any x > 1 is `undefined`,
• `acos(undefined) is`undefined`.
`asin`Source Code`shared Float asin(Float num)`

The arc sine of the given number.

• `asin(x)` for any x < -1 is `undefined`,
• `asin(-0)` is `-0`,
• `asin(+0)` is `+0`,
• `asin(x)` for any x > 1 is `undefined`,
• `asin(undefined) is`undefined`.
`atan`Source Code`shared Float atan(Float num)`

The arc tangent of the given number.

• `atan(-0)` is `-0`,
• `atan(+0)` is `+0`,
• `atan(undefined)` is `undefined`.
`atan2`Source Code`shared Float atan2(Float y, Float x)`

The angle from converting rectangular coordinates `x` and `y` to polar coordinates.

Special cases:

`y` `x` `atan2(y,x)`
`undefined` any value `undefined`
any value `undefined` `undefined`
`+0` `> 0` `+0`
`> 0` and not `+infinity` `+infinity` `+0`
`-0` `> 0` `-0`
`< 0` and not `-infinity` `+infinity` `-0`
`+0` `< 0` `π`
`> 0` and not `+infinity` `-infinity` `π`
`-0` `< 0` `-π`
`< 0` and not `-infinity` `-infinity` `-π`
`> 0` `+0 or -0` `π/2`
`+infinity` not `+infinity` or `-infinity` `π/2`
`< 0` `+0 or -0` `-π/2`
`-infinity` not `+infinity` or `-infinity` `-π/2`
`+infinity` `+infinity` `π/4`
`+infinity` `-infinity` `3π/4`
`-infinity` `+infinity` `-π/4`
`-infinity` `-infinity` `-3π/4`
`cbrt`Source Code`shared Float cbrt(Float num)`

The cube root of the given number. This method may be faster and/or more accurate than `num^(1.0/3.0)`.

• `cbrt(-infinity)` is `-infinity`,
• `cbrt(-0)` is `-0`,
• `cbrt(+0)` is `+0`,
• `cbrt(+infinity)` is `+infinity`,
• `cbrt(undefined)` is `undefined`.
`ceiling`Source Code`shared Float ceiling(Float num)`

The smallest value that is greater than or equal to the argument and equal to an integer.

• `ceiling(-infinity)` is `-infinity`,
• `ceiling(x)` for -1.0 < x < -0 is `-0`,
• `ceiling(-0)` is `-0`,
• `ceiling(+0)` is `+0`,
• `ceiling(+infinity)` is `+infinity`,
• `ceiling(undefined)` is `undefined`.
`cos`Source Code`shared Float cos(Float num)`

The cosine of the given angle specified in radians.

• `cos(-infinity)` is `undefined`,
• `cos(+infinity)` is `undefined`,
• `cos(undefined)` is `undefined`.
`cosh`Source Code`shared Float cosh(Float num)`

The hyperbolic cosine of the given angle specified in radians.

• `cosh(0)` is `1`.
• `cosh(-infinity)` is `+infinity`,
• `cosh(+infinity)` is `+infinity`,
• `cosh(undefined)` is `undefined`.
`exp`Source Code`shared Float exp(Float num)`

𝑒 raised to the power of the argument.

• `exp(-infinity)` is `+0`,
• `exp(+infinity)` is `+infinity`,
• `exp(undefined)` is `undefined`.
`expm1`Source Code`shared Float expm1(Float num)`

A more accurate computation of `exp(x)-1.0` for `x` near zero.

`floor`Source Code`shared Float floor(Float num)`

The largest value that is less than or equal to the argument and equal to an integer.

• `floor(-infinity)` is `-infinity`,
• `floor(-0)` is `-0`,
• `floor(+0)` is `+0`,
• `floor(+infinity)` is `+infinity`,
• `floor(undefined)` is `undefined`.
`halfEven`Source Code`shared Float halfEven(Float num)`

The closest value to the argument that is equal to a mathematical integer, with even values preferred in the event of a tie (half even rounding).

• `halfEven(-infinity)` is `-infinity`
• `halfEven(-0)` is `-0`
• `halfEven(+0)` is `+0`
• `halfEven(+infinity)` is `+infinity`
• `halfEven(undefined)` is `undefined`
`hypot`Source Code`shared Float hypot(Float x, Float y)`

Returns the length of the hypotenuse of a right angle triangle with other sides having lengths `x` and `y`. This method may be more accurate than computing `sqrt(x^2 + x^2)` directly.

• `hypot(x,y)` where `x` and/or `y` is `+infinity` or `-infinity`, is `+infinity`,
• `hypot(x,y)`, where `x` and/or `y` is `undefined`, is `undefined`.
`largest`Source Code`shared Float largest(Float x, Float y)`

The larger of the two arguments.

• `largest(-1,+0)` is `+0`
• `largest(undefined, x)` is `undefined`
• `largest(x, x)` is `x`
• `largest(+infinity,x) is`+infinity`
• `largest(-infinity,x) is`x`
`log`Source Code`shared Float log(Float num)`

The natural logarithm (base 𝑒) of the argument.

• `log(x)` for any x < 0 is `undefined`,
• `log(+0)` and `log(-0)` is `-infinity`,
• `log(+infinity)` is `+infinity`,
• `log(undefined)` is `undefined`.
`log10`Source Code`shared Float log10(Float num)`

The base 10 logarithm of the argument.

• `log10(x)` for any x < 0 is `undefined`,
• `log10(-0)` and `log10(+0)` is `-infinity`,
• `log10(+infinity)` is `+infinity`,
• `log10(undefined)` is `undefined`.
`log1p`Source Code`shared Float log1p(Float num)`

A more accurate computation of `log(1.0+x)` for `x` near zero.

`max`Source Code`shared Float|Absent max<Absent>(Iterable<Float,Absent> values)given Absent satisfies Null`

The largest `Float` in the given stream, or `null` if the stream is empty.

`min`Source Code`shared Float|Absent min<Absent>(Iterable<Float,Absent> values)given Absent satisfies Null`

The smallest `Float` in the given stream, or `null` if the stream is empty.

`product`Source Code`shared Float product({Float*}Go to Iterable abbreviation {X+} or {X*} means Iterable<X,Nothing> or Iterable<X,Null> values)`

The product of the values in the given stream, or `1.0` if the stream is empty.

`random`Source Code`shared Float random()`

A number greater than or equal to positive zero and less than `1.0`, chosen pseudorandomly and (approximately) uniformly distributed.

`remainder`Source Code`shared Float remainder(Float dividend, Float divisor)`

The remainder, after dividing the `dividend` by the `divisor`. This function is defined as:

```dividend - n * divisor
```

where `n` is the whole part of `dividend / divisor`. The result will have the same sign as the `dividend`.

• `remainder(infinity, divisor)` is `undefined`,
• `remainder(dividend, 0.0)` is `undefined`,
• `remainder(dividend, infinity)` is `dividend` for non-infinite dividends.
`scalb`Source Code`shared Float scalb(Float x, Integer n)`

The value of `x × 2ⁿ`, calculated exactly for reasonable values of `n` on JVM.

`sin`Source Code`shared Float sin(Float num)`

The sine of the given angle specified in radians.

• `sin(-0)` is `-0`,
• `sin(+0)` is `+0`,
• `sin(-infinity)` is `undefined`,
• `sin(+infinity)` is `undefined`,
• `sin(undefined)` is `undefined`.
`sinh`Source Code`shared Float sinh(Float num)`

The hyperbolic sine of the given angle specified in radians.

• `sinh(-0)` is `-0`,
• `sinh(+0)` is `+0`,
• `sinh(-infinity)` is `-infinity`,
• `sinh(+infinity)` is `+infinity`,
• `sinh(undefined)` is `undefined`.
`smallest`Source Code`shared Float smallest(Float x, Float y)`

The smaller of the two arguments.

• `smallest(-1,+0)` is `-0`
• `smallest(undefined, x)` is `undefined`
• `smallest(x, x)` is `x`
• `smallest(+infinity,x) is`x`
• `smallest(-infinity,x) is`-infinity`
`sqrt`Source Code`shared Float sqrt(Float num)`

The positive square root of the given number. This method may be faster and/or more accurate than `num^0.5`.

• `sqrt(x)` for any x < 0 is `undefined`,
• `sqrt(-0)` is `-0`,
• `sqrt(+0) is`+0`,
• `sqrt(+infinity)` is `+infinity`,
• `sqrt(undefined)` is `undefined`.
`sum`Source Code`shared Float sum({Float*}Go to Iterable abbreviation {X+} or {X*} means Iterable<X,Nothing> or Iterable<X,Null> values)`

The sum of the values in the given stream, or `0.0` if the stream is empty.

`tan`Source Code`shared Float tan(Float num)`

The tangent of the given angle specified in radians.

• `tan(-infinity)` is `undefined`,
• `tan(-0)` is `-0`,
• `tan(+0)` is `+0`,
• `tan(+infinity)` is `undefined`,
• `tan(undefined)` is `undefined`.
`tanh`Source Code`shared Float tanh(Float num)`

The hyperbolic tangent of the given angle specified in radians.

• `tanh(+infinity)` is `+1`,
• `tanh(-infinity)` is `-1`,
• `tanh(-0)` is `-0`,
• `tanh(+0)` is `+0`,
• `tanh(undefined)` is `undefined`.
`toDegrees`Source Code`shared Float toDegrees(Float num)`

The given angle (in radians) converted to degrees.

`toRadians`Source Code`shared Float toRadians(Float num)`

The given angle (in degrees) converted to radians.