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

pub struct Float(_);

Implementations

impl Float[src]

pub const DIG: Int[src]

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

Usually defaults to 15.

pub const EPSILON: Fp[src]

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

Usually defaults to 2.2204460492503131e-16.

pub const INFINITY: Fp[src]

An expression representing positive infinity.

pub const MANT_DIG: Int[src]

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

Usually defaults to 15.

pub const MAX: Fp[src]

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

Usually defaults to 1.7976931348623157e+308.

pub const MAX_10_EXP: Int[src]

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

Usually defaults to 308.

pub const MAX_EXP: Int[src]

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

Usually defaults to 1024.

pub const MIN: Fp[src]

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.

pub const MIN_10_EXP: Int[src]

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

Usually defaults to -307.

pub const MIN_EXP: Int[src]

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

Usually defaults to -1021.

pub const NAN: Fp[src]

An expression representing a value which is "not a number".

pub const NEG_INFINITY: Fp[src]

pub const RADIX: Int[src]

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.

pub const ROUNDS: Int[src]

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.

#[must_use]pub const fn new() -> Self[src]

Construct a new, zero, float.

#[must_use]pub const fn as_f64(self) -> f64[src]

Return the inner f64.

#[must_use]pub fn modulo(self, other: Self) -> Self[src]

Compute the remainder of self and other.

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

pub fn coerced_modulo(
    self,
    interp: &mut Artichoke,
    other: Value
) -> Result<Outcome, Error>
[src]

Trait Implementations

impl Clone for Float[src]

impl ConvertMut<Float, Value> for Artichoke[src]

impl Copy for Float[src]

impl Debug for Float[src]

impl Default for Float[src]

impl From<Float> for Fp[src]

impl From<Float> for Outcome[src]

impl From<f64> for Float[src]

impl PartialEq<Float> for Float[src]

impl PartialOrd<Float> for Float[src]

impl StructuralPartialEq for Float[src]

impl TryConvert<Value, Float> for Artichoke[src]

type Error = Error

Error type for failed conversions.

Auto Trait Implementations

impl RefUnwindSafe for Float[src]

impl Send for Float[src]

impl Sync for Float[src]

impl Unpin for Float[src]

impl UnwindSafe for Float[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]