Operations and constants for f64

Freeze NaN

f64

Freeze digits

uint

Freeze epsilon

f64

Freeze infinity

f64

Freeze mantissa_digits

uint

Freeze max_10_exp

int

Freeze max_exp

int

Freeze max_value

f64

Freeze min_10_exp

int

Freeze min_exp

int

Freeze min_value

f64

Freeze neg_infinity

f64

Freeze radix

uint

Implementation of Num for f64

Implementation of Eq for f64

Method eq

fn eq(&self, other: &f64) -> bool

Method ne

fn ne(&self, other: &f64) -> bool

Implementation of ApproxEq<f64> for f64

Method approx_epsilon

fn approx_epsilon() -> f64

Method approx_eq

fn approx_eq(&self, other: &f64) -> bool

Method approx_eq_eps

fn approx_eq_eps(&self, other: &f64, approx_epsilon: &f64) -> bool

Implementation of Ord for f64

Method lt

fn lt(&self, other: &f64) -> bool

Method le

fn le(&self, other: &f64) -> bool

Method ge

fn ge(&self, other: &f64) -> bool

Method gt

fn gt(&self, other: &f64) -> bool

Implementation of Orderable for f64

Method min

fn min(&self, other: &f64) -> f64

Returns NaN if either of the numbers are NaN.

Method max

fn max(&self, other: &f64) -> f64

Returns NaN if either of the numbers are NaN.

Method clamp

fn clamp(&self, mn: &f64, mx: &f64) -> f64

Returns the number constrained within the range mn <= self <= mx. If any of the numbers are NaN then NaN is returned.

Implementation of Zero for f64

Method zero

fn zero() -> f64

Method is_zero

fn is_zero(&self) -> bool

Returns true if the number is equal to either 0.0 or -0.0

Implementation of One for f64

Method one

fn one() -> f64

Implementation of Add<f64, f64> for f64

Method add

fn add(&self, other: &f64) -> f64

Implementation of Sub<f64, f64> for f64

Method sub

fn sub(&self, other: &f64) -> f64

Implementation of Mul<f64, f64> for f64

Method mul

fn mul(&self, other: &f64) -> f64

Implementation of Div<f64, f64> for f64

Method div

fn div(&self, other: &f64) -> f64

Implementation of Rem<f64, f64> for f64

Method rem

fn rem(&self, other: &f64) -> f64

Implementation of Neg<f64> for f64

Method neg

fn neg(&self) -> f64

Implementation of Signed for f64

Method abs

fn abs(&self) -> f64

Computes the absolute value. Returns NaN if the number is NaN.

Method abs_sub

fn abs_sub(&self, other: &f64) -> f64

The positive difference of two numbers. Returns 0.0 if the number is less than or equal to other, otherwise the difference betweenself and other is returned.

Method signum

fn signum(&self) -> f64

Returns

  • 1.0 if the number is positive, +0.0 or infinity
  • -1.0 if the number is negative, -0.0 or neg_infinity
  • NaN if the number is NaN

Method is_positive

fn is_positive(&self) -> bool

Returns true if the number is positive, including +0.0 and infinity

Method is_negative

fn is_negative(&self) -> bool

Returns true if the number is negative, including -0.0 and neg_infinity

Implementation of Round for f64

Method floor

fn floor(&self) -> f64

Round half-way cases toward neg_infinity

Method ceil

fn ceil(&self) -> f64

Round half-way cases toward infinity

Method round

fn round(&self) -> f64

Round half-way cases away from 0.0

Method trunc

fn trunc(&self) -> f64

The integer part of the number (rounds towards 0.0)

Method fract

fn fract(&self) -> f64

The fractional part of the number, satisfying:

assert!(x == trunc(x) + fract(x))

Implementation of Fractional for f64

Method recip

fn recip(&self) -> f64

The reciprocal (multiplicative inverse) of the number

Implementation of Algebraic for f64

Method pow

fn pow(&self, n: &f64) -> f64

Method sqrt

fn sqrt(&self) -> f64

Method rsqrt

fn rsqrt(&self) -> f64

Method cbrt

fn cbrt(&self) -> f64

Method hypot

fn hypot(&self, other: &f64) -> f64

Implementation of Trigonometric for f64

Method sin

fn sin(&self) -> f64

Method cos

fn cos(&self) -> f64

Method tan

fn tan(&self) -> f64

Method asin

fn asin(&self) -> f64

Method acos

fn acos(&self) -> f64

Method atan

fn atan(&self) -> f64

Method atan2

fn atan2(&self, other: &f64) -> f64

Method sin_cos

fn sin_cos(&self) -> (f64, f64)

Simultaneously computes the sine and cosine of the number

Implementation of Exponential for f64

Method exp

fn exp(&self) -> f64

Returns the exponential of the number

Method exp2

fn exp2(&self) -> f64

Returns 2 raised to the power of the number

Method ln

fn ln(&self) -> f64

Returns the natural logarithm of the number

Method log

fn log(&self, base: &f64) -> f64

Returns the logarithm of the number with respect to an arbitrary base

Method log2

fn log2(&self) -> f64

Returns the base 2 logarithm of the number

Method log10

fn log10(&self) -> f64

Returns the base 10 logarithm of the number

Implementation of Hyperbolic for f64

Method sinh

fn sinh(&self) -> f64

Method cosh

fn cosh(&self) -> f64

Method tanh

fn tanh(&self) -> f64

Method asinh

fn asinh(&self) -> f64

Inverse hyperbolic sine

Returns

  • on success, the inverse hyperbolic sine of self will be returned
  • self if self is 0.0, -0.0, infinity, or neg_infinity
  • NaN if self is NaN

Method acosh

fn acosh(&self) -> f64

Inverse hyperbolic cosine

Returns

  • on success, the inverse hyperbolic cosine of self will be returned
  • infinity if self is infinity
  • NaN if self is NaN or self < 1.0 (including neg_infinity)

Method atanh

fn atanh(&self) -> f64

Inverse hyperbolic tangent

Returns

  • on success, the inverse hyperbolic tangent of self will be returned
  • self if self is 0.0 or -0.0
  • infinity if self is 1.0
  • neg_infinity if self is -1.0
  • NaN if the self is NaN or outside the domain of -1.0 <= self <= 1.0 (including infinity and neg_infinity)

Implementation of Real for f64

Method pi

fn pi() -> f64

Archimedes' constant

Method two_pi

fn two_pi() -> f64

2.0 * pi

Method frac_pi_2

fn frac_pi_2() -> f64

pi / 2.0

Method frac_pi_3

fn frac_pi_3() -> f64

pi / 3.0

Method frac_pi_4

fn frac_pi_4() -> f64

pi / 4.0

Method frac_pi_6

fn frac_pi_6() -> f64

pi / 6.0

Method frac_pi_8

fn frac_pi_8() -> f64

pi / 8.0

Method frac_1_pi

fn frac_1_pi() -> f64

1.0 / pi

Method frac_2_pi

fn frac_2_pi() -> f64

2.0 / pi

Method frac_2_sqrtpi

fn frac_2_sqrtpi() -> f64

2.0 / sqrt(pi)

Method sqrt2

fn sqrt2() -> f64

sqrt(2.0)

Method frac_1_sqrt2

fn frac_1_sqrt2() -> f64

1.0 / sqrt(2.0)

Method e

fn e() -> f64

Euler's number

Method log2_e

fn log2_e() -> f64

log2(e)

Method log10_e

fn log10_e() -> f64

log10(e)

Method ln_2

fn ln_2() -> f64

ln(2.0)

Method ln_10

fn ln_10() -> f64

ln(10.0)

Method to_degrees

fn to_degrees(&self) -> f64

Converts to degrees, assuming the number is in radians

Method to_radians

fn to_radians(&self) -> f64

Converts to radians, assuming the number is in degrees

Implementation of RealExt for f64

Method lgamma

fn lgamma(&self) -> (int, f64)

Method tgamma

fn tgamma(&self) -> f64

Method j0

fn j0(&self) -> f64

Method j1

fn j1(&self) -> f64

Method jn

fn jn(&self, n: int) -> f64

Method y0

fn y0(&self) -> f64

Method y1

fn y1(&self) -> f64

Method yn

fn yn(&self, n: int) -> f64

Implementation of Bounded for f64

Method min_value

fn min_value() -> f64

Method max_value

fn max_value() -> f64

Implementation of Primitive for f64

Method bits

fn bits() -> uint

Method bytes

fn bytes() -> uint

Implementation of Float for f64

Method NaN

fn NaN() -> f64

Method infinity

fn infinity() -> f64

Method neg_infinity

fn neg_infinity() -> f64

Method neg_zero

fn neg_zero() -> f64

Method is_NaN

fn is_NaN(&self) -> bool

Returns true if the number is NaN

Method is_infinite

fn is_infinite(&self) -> bool

Returns true if the number is infinite

Method is_finite

fn is_finite(&self) -> bool

Returns true if the number is neither infinite or NaN

Method is_normal

fn is_normal(&self) -> bool

Returns true if the number is neither zero, infinite, subnormal or NaN

Method classify

fn classify(&self) -> FPCategory

Returns the floating point category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead.

Method mantissa_digits

fn mantissa_digits() -> uint

Method digits

fn digits() -> uint

Method epsilon

fn epsilon() -> f64

Method min_exp

fn min_exp() -> int

Method max_exp

fn max_exp() -> int

Method min_10_exp

fn min_10_exp() -> int

Method max_10_exp

fn max_10_exp() -> int

Method ldexp

fn ldexp(x: f64, exp: int) -> f64

Constructs a floating point number by multiplying x by 2 raised to the power of exp

Method frexp

fn frexp(&self) -> (f64, int)

Breaks the number into a normalized fraction and a base-2 exponent, satisfying:

Method exp_m1

fn exp_m1(&self) -> f64

Returns the exponential of the number, minus 1, in a way that is accurate even if the number is close to zero

Method ln_1p

fn ln_1p(&self) -> f64

Returns the natural logarithm of the number plus 1 (ln(1+n)) more accurately than if the operations were performed separately

Method mul_add

fn mul_add(&self, a: f64, b: f64) -> f64

Fused multiply-add. Computes (self * a) + b with only one rounding error. This produces a more accurate result with better performance than a separate multiplication operation followed by an add.

Method next_after

fn next_after(&self, other: f64) -> f64

Returns the next representable floating-point value in the direction of other

Implementation of to_str::ToStr for f64

Method to_str

fn to_str(&self) -> ~str

Implementation of num::ToStrRadix for f64

Method to_str_radix

fn to_str_radix(&self, rdx: uint) -> ~str

Implementation of FromStr for f64

Method from_str

fn from_str(val: &str) -> Option<f64>

Implementation of num::FromStrRadix for f64

Method from_str_radix

fn from_str_radix(val: &str, rdx: uint) -> Option<f64>

Function add

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

Function div

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

Function eq

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

Function fmax

fn fmax(x: f64, y: f64) -> f64

Function fmin

fn fmin(x: f64, y: f64) -> f64

Function from_str

fn from_str(num: &str) -> Option<f64>

Convert a string in base 10 to a float. Accepts a optional decimal exponent.

This function accepts strings such as

Leading and trailing whitespace represent an error.

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 from_str_hex

fn from_str_hex(num: &str) -> Option<f64>

Convert a string in base 16 to a float. Accepts a optional binary exponent.

This function accepts strings such as

Leading and trailing whitespace represent an error.

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 from_str_radix

fn from_str_radix(num: &str, rdx: uint) -> Option<f64>

Convert a string in an given base to a float.

Due to possible conflicts, this function does not accept the special values inf, -inf, +inf and NaN, nor does it recognize exponents of any kind.

Leading and trailing whitespace represent an error.

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 ge

fn ge(x: f64, y: f64) -> bool

Function gt

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

Function le

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

Function lt

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

Function mul

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

Function ne

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

Function rem

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

Function sub

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

Function to_str

fn to_str(num: f64) -> ~str

Converts a float to a string

Arguments

Function to_str_digits

fn to_str_digits(num: f64, dig: uint) -> ~str

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

Arguments

Function to_str_exact

fn to_str_exact(num: f64, dig: uint) -> ~str

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

Arguments

Function to_str_hex

fn to_str_hex(num: f64) -> ~str

Converts a float to a string in hexadecimal format

Arguments

Function to_str_radix

fn to_str_radix(num: f64, rdx: uint) -> ~str

Converts a float to a string in a given radix

Arguments

Failure

Fails if called on a special value like inf, -inf or NaN due to possible misinterpretation of the result at higher bases. If those values are expected, use to_str_radix_special() instead.

Function to_str_radix_special

fn to_str_radix_special(num: f64, rdx: uint) -> (~str, bool)

Converts a float to a string in a given radix, and a flag indicating whether it's a special value

Arguments