Operations and constants for float

Const NaN

float

Const infinity

float

Const neg_infinity

float

Implementation num of num::num for float

Method add

fn add(&&other: float) -> float

Method sub

fn sub(&&other: float) -> float

Method mul

fn mul(&&other: float) -> float

Method div

fn div(&&other: float) -> float

Method modulo

fn modulo(&&other: float) -> float

Method neg

fn neg() -> float

Method to_int

fn to_int() -> int

Method from_int

fn from_int(n: int) -> float

Function abs

fn abs(x: float) -> float

Function abs_sub

pure fn abs_sub(a: c_double, b: c_double) -> c_double

Function acos

pure fn acos(n: c_double) -> c_double

Function add

pure fn add(x: f64, y: f64) -> f64

Function asin

pure fn asin(n: c_double) -> c_double

Function atan

fn atan(x: float) -> float

Function atan2

pure fn atan2(a: c_double, b: c_double) -> c_double

Function cbrt

pure fn cbrt(n: c_double) -> c_double

Function ceil

pure fn ceil(n: c_double) -> c_double

Function copysign

pure fn copysign(x: c_double, y: c_double) -> c_double

Function cos

fn cos(x: float) -> float

Function cosh

pure fn cosh(n: c_double) -> c_double

Function div

pure fn div(x: f64, y: f64) -> f64

Function eq

pure fn eq(x: f64, y: f64) -> bool

Function erf

pure fn erf(n: c_double) -> c_double

Function erfc

pure fn erfc(n: c_double) -> c_double

Function exp

pure fn exp(n: c_double) -> c_double

Function exp2

pure fn exp2(n: c_double) -> c_double

Function expm1

pure fn expm1(n: c_double) -> c_double

Function floor

pure fn floor(n: c_double) -> c_double

Function fmax

pure fn fmax(a: c_double, b: c_double) -> c_double

Function fmin

pure fn fmin(a: c_double, b: c_double) -> c_double

Function frexp

pure fn frexp(n: c_double, &value: c_int) -> c_double

Function from_str

fn from_str(num: str) -> option<float>

Convert a string to a float

This function accepts strings such as

Leading and trailing whitespace are ignored.

Arguments

Return value

none if the string did not represent a valid number. Otherwise, some(n) where n is the floating-point number represented by [num]/~.

Function gt

pure fn gt(x: f64, y: f64) -> bool

Function hypot

pure fn hypot(x: c_double, y: c_double) -> c_double

Function ilog_radix

pure fn ilog_radix(n: c_double) -> c_int

Function is_NaN

fn is_NaN(x: float) -> bool

Function is_finite

fn is_finite(x: float) -> bool

Function is_infinite

fn is_infinite(x: float) -> bool

Function is_negative

fn is_negative(x: float) -> bool

Function is_nonnegative

fn is_nonnegative(x: float) -> bool

Function is_nonpositive

fn is_nonpositive(x: float) -> bool

Function is_positive

fn is_positive(x: float) -> bool

Function is_zero

fn is_zero(x: float) -> bool

Function j0

pure fn j0(n: c_double) -> c_double

Function j1

pure fn j1(n: c_double) -> c_double

Function jn

pure fn jn(i: c_int, n: c_double) -> c_double

Function ldexp

pure fn ldexp(x: c_double, n: c_int) -> c_double

Function le

pure fn le(x: f64, y: f64) -> bool

Function lgamma

pure fn lgamma(n: c_double, &sign: c_int) -> c_double

Function ln

pure fn ln(n: c_double) -> c_double

Function ln1p

pure fn ln1p(n: c_double) -> c_double

Function log10

pure fn log10(n: c_double) -> c_double

Function log2

pure fn log2(n: c_double) -> c_double

Function log_radix

pure fn log_radix(n: c_double) -> c_double

Function logarithm

pure fn logarithm(n: f64, b: f64) -> f64

Function lt

pure fn lt(x: f64, y: f64) -> bool

Function modf

pure fn modf(n: c_double, &iptr: c_double) -> c_double

Function mul

pure fn mul(x: f64, y: f64) -> f64

Function mul_add

pure fn mul_add(a: c_double, b: c_double, c: c_double) -> c_double

Function ne

pure fn ne(x: f64, y: f64) -> bool

Function nextafter

pure fn nextafter(x: c_double, y: c_double) -> c_double

Function pow

pure fn pow(n: c_double, e: c_double) -> c_double

Function pow_with_uint

fn pow_with_uint(base: uint, pow: uint) -> float

Section: Arithmetics

Function rem

pure fn rem(x: f64, y: f64) -> f64

Function round

pure fn round(n: c_double) -> c_double

Function signbit

pure fn signbit(x: f64) -> int

Function sin

fn sin(x: float) -> float

Function sinh

pure fn sinh(n: c_double) -> c_double

Function sqrt

fn sqrt(x: float) -> float

Function sub

pure fn sub(x: f64, y: f64) -> f64

Function tan

fn tan(x: float) -> float

Function tanh

pure fn tanh(n: c_double) -> c_double

Function tgamma

pure fn tgamma(n: c_double) -> c_double

Function to_str

fn to_str(num: float, digits: uint) -> str

Converts a float to a string with a maximum number of significant digits

Arguments

Function to_str_common

fn to_str_common(num: float, digits: uint, exact: bool) -> str

Section: String Conversions

Function to_str_exact

fn to_str_exact(num: float, digits: uint) -> str

Converts a float to a string with exactly the number of provided significant digits

Arguments

Function trunc

pure fn trunc(n: c_double) -> c_double

Function y0

pure fn y0(n: c_double) -> c_double

Function y1

pure fn y1(n: c_double) -> c_double

Function yn

pure fn yn(i: c_int, n: c_double) -> c_double