Struct artichoke_backend::extn::core::float::Float[][src]

#[repr(transparent)]
pub struct Float(_);

Implementations

The minimum number of significant decimal digits in a double-precision floating point.

Usually defaults to 15.

The difference between 1 and the smallest double-precision floating point number greater than 1.

Usually defaults to 2.2204460492503131e-16.

An expression representing positive infinity.

The minimum number of significant decimal digits in a double-precision floating point.

Usually defaults to 15.

The largest possible integer in a double-precision floating point number.

Usually defaults to 1.7976931348623157e+308.

The largest positive exponent in a double-precision floating point where 10 raised to this power minus 1.

Usually defaults to 308.

The largest possible exponent value in a double-precision floating point.

Usually defaults to 1024.

The smallest positive normalized number in a double-precision floating point.

Usually defaults to 2.2250738585072014e-308.

If the platform supports denormalized numbers, there are numbers between zero and Float::MIN. 0.0.next_float returns the smallest positive floating point number including denormalized numbers.

The smallest negative exponent in a double-precision floating point where 10 raised to this power minus 1.

Usually defaults to -307.

The smallest possible exponent value in a double-precision floating point.

Usually defaults to -1021.

An expression representing a value which is “not a number”.

The base of the floating point, or number of unique digits used to represent the number.

Usually defaults to 2 on most systems, which would represent a base-10 decimal.

Represents the rounding mode for floating point addition.

Usually defaults to 1, rounding to the nearest number.

Other modes include:

modevalue
Indeterminable-1
Rounding towards zero0
Rounding to the nearest number1
Rounding towards positive infinity2
Rounding towards negative infinity3

Rust Caveats

Rust does not support setting the rounding mode and the behavior from LLVM is not documented. Because of this uncertainty, Artichoke sets its rounding mode to -1, Indeterminable.

The Rust docs say f64::round rounds “half-way cases away from 0.0.” Stack Overflow has a discussion around float rounding semantics in Rust and LLVM.

Construct a new, zero, float.

Construct a new Float with a given f64.

Convert self to an i64 with a saturating cast.

Return the inner f64.

Compute the remainder of self and other.

Equivalent to self.as_f64() % other.as_f64().

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Performs the infallible conversion.

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Error type for failed conversions.

Performs the fallible conversion. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.