[−][src]Struct artichoke_backend::extn::core::float::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:
mode | value |
---|---|
Indeterminable | -1 |
Rounding towards zero | 0 |
Rounding to the nearest number | 1 |
Rounding towards positive infinity | 2 |
Rounding towards negative infinity | 3 |
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]
self,
interp: &mut Artichoke,
other: Value
) -> Result<Outcome, Error>
Trait Implementations
impl Clone for Float
[src]
impl ConvertMut<Float, Value> for Artichoke
[src]
fn convert_mut(&mut self, from: Float) -> Value
[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]
fn partial_cmp(&self, other: &Float) -> Option<Ordering>
[src]
fn lt(&self, other: &Float) -> bool
[src]
fn le(&self, other: &Float) -> bool
[src]
fn gt(&self, other: &Float) -> bool
[src]
fn ge(&self, other: &Float) -> bool
[src]
impl StructuralPartialEq for Float
[src]
impl TryConvert<Value, Float> for Artichoke
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,