Operations and constants for float

Const NaN

float

Const infinity

float

Const neg_infinity

float

Implementation 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

Implementation of num::Zero for float

Method zero

fn zero() -> float

Implementation of num::One for float

Method one

fn one() -> float

Function abs

fn abs(x: float) -> float

Function atan

fn atan(x: float) -> float

Function cos

fn cos(x: float) -> float

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 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 pow_with_uint

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

Section: Arithmetics Compute the exponentiation of an integer by another integer as a float

Arguments

Return value

NaN if both x and pow are 0u, otherwise x^pow

Function sin

fn sin(x: float) -> float

Function sqrt

fn sqrt(x: float) -> float

Function tan

fn tan(x: float) -> float

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 Converts a float to a string

Arguments

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