Struct tract_core::internal::f16
source · [−]pub struct f16(pub f16);
Tuple Fields
0: f16
Trait Implementations
sourceimpl AddAssign<f16> for f16
impl AddAssign<f16> for f16
sourcefn add_assign(&mut self, other: f16)
fn add_assign(&mut self, other: f16)
Performs the +=
operation. Read more
sourceimpl AsPrimitive<f16> for i16
impl AsPrimitive<f16> for i16
sourceimpl AsPrimitive<f16> for u8
impl AsPrimitive<f16> for u8
sourceimpl AsPrimitive<f16> for f16
impl AsPrimitive<f16> for f16
sourceimpl AsPrimitive<f16> for i64
impl AsPrimitive<f16> for i64
sourceimpl AsPrimitive<f16> for i32
impl AsPrimitive<f16> for i32
sourceimpl AsPrimitive<f16> for i8
impl AsPrimitive<f16> for i8
sourceimpl AsPrimitive<f16> for u16
impl AsPrimitive<f16> for u16
sourceimpl AsPrimitive<f16> for u32
impl AsPrimitive<f16> for u32
sourceimpl AsPrimitive<f16> for isize
impl AsPrimitive<f16> for isize
sourceimpl AsPrimitive<f16> for f64
impl AsPrimitive<f16> for f64
sourceimpl AsPrimitive<f16> for usize
impl AsPrimitive<f16> for usize
sourceimpl AsPrimitive<f16> for u64
impl AsPrimitive<f16> for u64
sourceimpl AsPrimitive<f16> for f32
impl AsPrimitive<f16> for f32
sourceimpl AsPrimitive<f32> for f16
impl AsPrimitive<f32> for f16
sourceimpl AsPrimitive<f64> for f16
impl AsPrimitive<f64> for f16
sourceimpl AsPrimitive<i16> for f16
impl AsPrimitive<i16> for f16
sourceimpl AsPrimitive<i32> for f16
impl AsPrimitive<i32> for f16
sourceimpl AsPrimitive<i64> for f16
impl AsPrimitive<i64> for f16
sourceimpl AsPrimitive<i8> for f16
impl AsPrimitive<i8> for f16
sourceimpl AsPrimitive<isize> for f16
impl AsPrimitive<isize> for f16
sourceimpl AsPrimitive<u16> for f16
impl AsPrimitive<u16> for f16
sourceimpl AsPrimitive<u32> for f16
impl AsPrimitive<u32> for f16
sourceimpl AsPrimitive<u64> for f16
impl AsPrimitive<u64> for f16
sourceimpl AsPrimitive<u8> for f16
impl AsPrimitive<u8> for f16
sourceimpl AsPrimitive<usize> for f16
impl AsPrimitive<usize> for f16
sourceimpl DivAssign<f16> for f16
impl DivAssign<f16> for f16
sourcefn div_assign(&mut self, other: f16)
fn div_assign(&mut self, other: f16)
Performs the /=
operation. Read more
sourceimpl Float for f16
impl Float for f16
sourcefn round(self) -> f16
fn round(self) -> f16
Returns the nearest integer to a number. Round half-way cases away from
0.0
. Read more
sourcefn abs(self) -> f16
fn abs(self) -> f16
Computes the absolute value of self
. Returns Float::nan()
if the
number is Float::nan()
. Read more
sourcefn asin(self) -> f16
fn asin(self) -> f16
Computes the arcsine of a number. Return value is in radians in the range [-pi/2, pi/2] or NaN if the number is outside the range [-1, 1]. Read more
sourcefn acos(self) -> f16
fn acos(self) -> f16
Computes the arccosine of a number. Return value is in radians in the range [0, pi] or NaN if the number is outside the range [-1, 1]. Read more
sourcefn atan(self) -> f16
fn atan(self) -> f16
Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2]; Read more
sourcefn exp_m1(self) -> f16
fn exp_m1(self) -> f16
Returns e^(self) - 1
in a way that is accurate even if the
number is close to zero. Read more
sourcefn ln_1p(self) -> f16
fn ln_1p(self) -> f16
Returns ln(1+n)
(natural logarithm) more accurately than if
the operations were performed separately. Read more
sourcefn classify(self) -> FpCategory
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. Read more
sourcefn is_infinite(self) -> bool
fn is_infinite(self) -> bool
Returns true
if this value is positive infinity or negative infinity and
false otherwise. Read more
sourcefn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
Returns true
if self
is positive, including +0.0
,
Float::infinity()
, and since Rust 1.20 also Float::nan()
. Read more
sourcefn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
Returns true
if self
is negative, including -0.0
,
Float::neg_infinity()
, and since Rust 1.20 also -Float::nan()
. Read more
sourcefn log(self, other: f16) -> f16
fn log(self, other: f16) -> f16
Returns the logarithm of the number with respect to an arbitrary base. Read more
sourcefn hypot(self, other: f16) -> f16
fn hypot(self, other: f16) -> f16
Calculate the length of the hypotenuse of a right-angle triangle given
legs of length x
and y
. Read more
sourcefn atan2(self, other: f16) -> f16
fn atan2(self, other: f16) -> f16
Computes the four quadrant arctangent of self
(y
) and other
(x
). Read more
sourcefn neg_infinity() -> f16
fn neg_infinity() -> f16
Returns the negative infinite value. Read more
sourcefn min_value() -> f16
fn min_value() -> f16
Returns the smallest finite value that this type can represent. Read more
sourcefn min_positive_value() -> f16
fn min_positive_value() -> f16
Returns the smallest positive, normalized value that this type can represent. Read more
sourcefn mul_add(self, a: f16, b: f16) -> f16
fn mul_add(self, a: f16, b: f16) -> f16
Fused multiply-add. Computes (self * a) + b
with only one rounding
error, yielding a more accurate result than an unfused multiply-add. Read more
sourcefn sin_cos(self) -> (f16, f16)
fn sin_cos(self) -> (f16, f16)
Simultaneously computes the sine and cosine of the number, x
. Returns
(sin(x), cos(x))
. Read more
sourcefn integer_decode(self) -> (u64, i16, i8)
fn integer_decode(self) -> (u64, i16, i8)
Returns the mantissa, base 2 exponent, and sign as integers, respectively.
The original number can be recovered by sign * mantissa * 2 ^ exponent
. Read more
sourcefn to_degrees(self) -> Self
fn to_degrees(self) -> Self
Converts radians to degrees. Read more
sourcefn to_radians(self) -> Self
fn to_radians(self) -> Self
Converts degrees to radians. Read more
sourceimpl Num for f16
impl Num for f16
type FromStrRadixErr = <f32 as Num>::FromStrRadixErr
sourcefn from_str_radix(
str: &str,
radix: u32
) -> Result<f16, <f16 as Num>::FromStrRadixErr>
fn from_str_radix(
str: &str,
radix: u32
) -> Result<f16, <f16 as Num>::FromStrRadixErr>
Convert from a string and radix (typically 2..=36
). Read more
sourceimpl PartialOrd<f16> for f16
impl PartialOrd<f16> for f16
sourcefn partial_cmp(&self, other: &f16) -> Option<Ordering>
fn partial_cmp(&self, other: &f16) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Signed for f16
impl Signed for f16
sourcefn is_positive(&self) -> bool
fn is_positive(&self) -> bool
Returns true if the number is positive and false if the number is zero or negative.
sourcefn is_negative(&self) -> bool
fn is_negative(&self) -> bool
Returns true if the number is negative and false if the number is zero or positive.
sourceimpl SloppyHash for f16
impl SloppyHash for f16
fn sloppy_hash<S: Hasher>(&self, state: &mut S)
sourceimpl ToPrimitive for f16
impl ToPrimitive for f16
sourcefn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
Converts the value of self
to an i64
. If the value cannot be
represented by an i64
, then None
is returned. Read more
sourcefn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
Converts the value of self
to a u64
. If the value cannot be
represented by a u64
, then None
is returned. Read more
sourcefn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
Converts the value of self
to an isize
. If the value cannot be
represented by an isize
, then None
is returned. Read more
sourcefn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
Converts the value of self
to an i8
. If the value cannot be
represented by an i8
, then None
is returned. Read more
sourcefn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
Converts the value of self
to an i16
. If the value cannot be
represented by an i16
, then None
is returned. Read more
sourcefn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
Converts the value of self
to an i32
. If the value cannot be
represented by an i32
, then None
is returned. Read more
sourcefn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
Converts the value of self
to an i128
. If the value cannot be
represented by an i128
(i64
under the default implementation), then
None
is returned. Read more
sourcefn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
Converts the value of self
to a usize
. If the value cannot be
represented by a usize
, then None
is returned. Read more
sourcefn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
Converts the value of self
to a u8
. If the value cannot be
represented by a u8
, then None
is returned. Read more
sourcefn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
Converts the value of self
to a u16
. If the value cannot be
represented by a u16
, then None
is returned. Read more
sourcefn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
Converts the value of self
to a u32
. If the value cannot be
represented by a u32
, then None
is returned. Read more
sourcefn to_u128(&self) -> Option<u128>
fn to_u128(&self) -> Option<u128>
Converts the value of self
to a u128
. If the value cannot be
represented by a u128
(u64
under the default implementation), then
None
is returned. Read more
impl Copy for f16
impl StructuralPartialEq for f16
Auto Trait Implementations
impl RefUnwindSafe for f16
impl Send for f16
impl Sync for f16
impl Unpin for f16
impl UnwindSafe for f16
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ClampCast for T where
T: 'static + PartialOrd<T> + Copy,
impl<T> ClampCast for T where
T: 'static + PartialOrd<T> + Copy,
fn clamp_cast<O>(self) -> O where
Self: AsPrimitive<O> + Datum,
O: AsPrimitive<Self> + Bounded + Datum,
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
sourceimpl<T> LowerBounded for T where
T: Bounded,
impl<T> LowerBounded for T where
T: Bounded,
sourceimpl<T> Real for T where
T: Float,
impl<T> Real for T where
T: Float,
sourcefn min_positive_value() -> T
fn min_positive_value() -> T
Returns the smallest positive, normalized value that this type can represent. Read more
sourcefn round(self) -> T
fn round(self) -> T
Returns the nearest integer to a number. Round half-way cases away from
0.0
. Read more
sourcefn abs(self) -> T
fn abs(self) -> T
Computes the absolute value of self
. Returns Float::nan()
if the
number is Float::nan()
. Read more
sourcefn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
Returns true
if self
is positive, including +0.0
,
Float::infinity()
, and with newer versions of Rust f64::NAN
. Read more
sourcefn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
Returns true
if self
is negative, including -0.0
,
Float::neg_infinity()
, and with newer versions of Rust -f64::NAN
. Read more
sourcefn mul_add(self, a: T, b: T) -> T
fn mul_add(self, a: T, b: T) -> T
Fused multiply-add. Computes (self * a) + b
with only one rounding
error, yielding a more accurate result than an unfused multiply-add. Read more
sourcefn log(self, base: T) -> T
fn log(self, base: T) -> T
Returns the logarithm of the number with respect to an arbitrary base. Read more
sourcefn to_degrees(self) -> T
fn to_degrees(self) -> T
Converts radians to degrees. Read more
sourcefn to_radians(self) -> T
fn to_radians(self) -> T
Converts degrees to radians. Read more
sourcefn hypot(self, other: T) -> T
fn hypot(self, other: T) -> T
Calculate the length of the hypotenuse of a right-angle triangle given
legs of length x
and y
. Read more
sourcefn asin(self) -> T
fn asin(self) -> T
Computes the arcsine of a number. Return value is in radians in the range [-pi/2, pi/2] or NaN if the number is outside the range [-1, 1]. Read more
sourcefn acos(self) -> T
fn acos(self) -> T
Computes the arccosine of a number. Return value is in radians in the range [0, pi] or NaN if the number is outside the range [-1, 1]. Read more
sourcefn atan(self) -> T
fn atan(self) -> T
Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2]; Read more
sourcefn atan2(self, other: T) -> T
fn atan2(self, other: T) -> T
Computes the four quadrant arctangent of self
(y
) and other
(x
). Read more
sourcefn sin_cos(self) -> (T, T)
fn sin_cos(self) -> (T, T)
Simultaneously computes the sine and cosine of the number, x
. Returns
(sin(x), cos(x))
. Read more
sourcefn exp_m1(self) -> T
fn exp_m1(self) -> T
Returns e^(self) - 1
in a way that is accurate even if the
number is close to zero. Read more