Struct typed_floats::Positive
source · pub struct Positive<T = f64>(/* private fields */);
Expand description
A non-NaN positive floating point number
It satisfies the following constraints:
- It is not NaN.
- It is not negative.
Implementations§
source§impl Positive
impl Positive
sourcepub const fn accept_infinity() -> bool
pub const fn accept_infinity() -> bool
Returns true if the type can accept infinity
sourcepub const fn accept_zero() -> bool
pub const fn accept_zero() -> bool
Returns true if the type can accept zero
sourcepub const fn accept_negative() -> bool
pub const fn accept_negative() -> bool
Returns true if the type can accept negative values
sourcepub const fn accept_positive() -> bool
pub const fn accept_positive() -> bool
Returns true if the type can accept positive values
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn new(value: f32) -> Result<Self, InvalidNumber>
pub fn new(value: f32) -> Result<Self, InvalidNumber>
sourcepub unsafe fn new_unchecked(value: f32) -> Self
pub unsafe fn new_unchecked(value: f32) -> Self
Creates a new value from a primitive type with zero overhead (in release mode). It is up to the caller to ensure that the value is valid
§Examples
let x = unsafe { Positive::new_unchecked(3.0) };
assert_eq!(x, 3.0);
§Safety
The caller must ensure that the value is valid. It will panic in debug mode if the value is not valid, but in release mode the behavior is undefined
sourcepub const fn get(&self) -> f32
pub const fn get(&self) -> f32
Returns the value as a primitive type
§Examples
use typed_floats::tf32::Positive;
let x = Positive::new(3.0).unwrap();
let y: f32 = x.into();
assert_eq!(y, 3.0);
sourcepub const fn is_nan(&self) -> bool
pub const fn is_nan(&self) -> bool
Returns true
if this value is NaN.
This is never the case for the provided types
§Examples
use typed_floats::tf32::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_nan(), false);
See f32::is_nan()
for more details.
sourcepub fn is_infinite(&self) -> bool
pub fn is_infinite(&self) -> bool
Returns true
if this value is positive infinity or negative infinity.
§Examples
use typed_floats::tf32::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_infinite(), false);
See f32::is_infinite()
for more details.
sourcepub fn is_finite(&self) -> bool
pub fn is_finite(&self) -> bool
Returns true
if this number is positive infinity nor negative infinity.
§Examples
use typed_floats::tf32::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_finite(), true);
See f32::is_finite()
for more details.
sourcepub fn is_subnormal(&self) -> bool
pub fn is_subnormal(&self) -> bool
Returns true
if the number is subnormal.
§Examples
use typed_floats::tf32::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_subnormal(), false);
See f32::is_subnormal()
for more details.
sourcepub fn is_normal(&self) -> bool
pub fn is_normal(&self) -> bool
Returns true
if the number is neither zero, infinite or subnormal.
§Examples
use typed_floats::tf32::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_normal(), true);
See f32::is_normal()
for more details.
sourcepub fn classify(&self) -> FpCategory
pub 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.
§Examples
use typed_floats::tf32::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.classify(), core::num::FpCategory::Normal);
See f32::classify()
for more details.
sourcepub const fn is_sign_positive(&self) -> bool
pub const fn is_sign_positive(&self) -> bool
Returns true
if self
has a positive sign, including +0.0
and positive infinity.
§Examples
use typed_floats::tf32::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_sign_positive(), true);
See f32::is_sign_positive()
for more details.
sourcepub const fn is_sign_negative(&self) -> bool
pub const fn is_sign_negative(&self) -> bool
Returns true
if self
has a negative sign, including -0.0
and negative infinity.
§Examples
use typed_floats::tf32::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_sign_negative(), false);
See f32::is_sign_negative()
for more details.
sourcepub const fn is_negative_zero(&self) -> bool
pub const fn is_negative_zero(&self) -> bool
Returns true
if the number is negative zero.
§Examples
use typed_floats::tf32::Positive;
let x: Positive = 3.0.try_into().unwrap();
let y: Positive = 0.0.try_into().unwrap();
assert_eq!(x.is_negative_zero(), false);
assert_eq!(y.is_negative_zero(), false);
sourcepub fn is_positive_zero(&self) -> bool
pub fn is_positive_zero(&self) -> bool
Returns true
if the number is positive zero.
§Examples
use typed_floats::tf32::Positive;
let x: Positive = 3.0.try_into().unwrap();
let y: Positive = 0.0.try_into().unwrap();
assert_eq!(x.is_positive_zero(), false);
assert_eq!(y.is_positive_zero(), true);
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn new(value: f64) -> Result<Self, InvalidNumber>
pub fn new(value: f64) -> Result<Self, InvalidNumber>
sourcepub unsafe fn new_unchecked(value: f64) -> Self
pub unsafe fn new_unchecked(value: f64) -> Self
Creates a new value from a primitive type with zero overhead (in release mode). It is up to the caller to ensure that the value is valid
§Examples
let x = unsafe { Positive::new_unchecked(3.0) };
assert_eq!(x, 3.0);
§Safety
The caller must ensure that the value is valid. It will panic in debug mode if the value is not valid, but in release mode the behavior is undefined
sourcepub const fn get(&self) -> f64
pub const fn get(&self) -> f64
Returns the value as a primitive type
§Examples
use typed_floats::tf64::Positive;
let x = Positive::new(3.0).unwrap();
let y: f64 = x.into();
assert_eq!(y, 3.0);
sourcepub const fn is_nan(&self) -> bool
pub const fn is_nan(&self) -> bool
Returns true
if this value is NaN.
This is never the case for the provided types
§Examples
use typed_floats::tf64::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_nan(), false);
See f64::is_nan()
for more details.
sourcepub fn is_infinite(&self) -> bool
pub fn is_infinite(&self) -> bool
Returns true
if this value is positive infinity or negative infinity.
§Examples
use typed_floats::tf64::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_infinite(), false);
See f64::is_infinite()
for more details.
sourcepub fn is_finite(&self) -> bool
pub fn is_finite(&self) -> bool
Returns true
if this number is positive infinity nor negative infinity.
§Examples
use typed_floats::tf64::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_finite(), true);
See f64::is_finite()
for more details.
sourcepub fn is_subnormal(&self) -> bool
pub fn is_subnormal(&self) -> bool
Returns true
if the number is subnormal.
§Examples
use typed_floats::tf64::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_subnormal(), false);
See f64::is_subnormal()
for more details.
sourcepub fn is_normal(&self) -> bool
pub fn is_normal(&self) -> bool
Returns true
if the number is neither zero, infinite or subnormal.
§Examples
use typed_floats::tf64::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_normal(), true);
See f64::is_normal()
for more details.
sourcepub fn classify(&self) -> FpCategory
pub 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.
§Examples
use typed_floats::tf64::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.classify(), core::num::FpCategory::Normal);
See f64::classify()
for more details.
sourcepub const fn is_sign_positive(&self) -> bool
pub const fn is_sign_positive(&self) -> bool
Returns true
if self
has a positive sign, including +0.0
and positive infinity.
§Examples
use typed_floats::tf64::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_sign_positive(), true);
See f64::is_sign_positive()
for more details.
sourcepub const fn is_sign_negative(&self) -> bool
pub const fn is_sign_negative(&self) -> bool
Returns true
if self
has a negative sign, including -0.0
and negative infinity.
§Examples
use typed_floats::tf64::Positive;
let x: Positive = 3.0.try_into().unwrap();
assert_eq!(x.is_sign_negative(), false);
See f64::is_sign_negative()
for more details.
sourcepub const fn is_negative_zero(&self) -> bool
pub const fn is_negative_zero(&self) -> bool
Returns true
if the number is negative zero.
§Examples
use typed_floats::tf64::Positive;
let x: Positive = 3.0.try_into().unwrap();
let y: Positive = 0.0.try_into().unwrap();
assert_eq!(x.is_negative_zero(), false);
assert_eq!(y.is_negative_zero(), false);
sourcepub fn is_positive_zero(&self) -> bool
pub fn is_positive_zero(&self) -> bool
Returns true
if the number is positive zero.
§Examples
use typed_floats::tf64::Positive;
let x: Positive = 3.0.try_into().unwrap();
let y: Positive = 0.0.try_into().unwrap();
assert_eq!(x.is_positive_zero(), false);
assert_eq!(y.is_positive_zero(), true);
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn abs(self) -> Positive<f64>
pub fn abs(self) -> Positive<f64>
Computes the absolute value of self
.
§Examples
let a: NonNaN = 3.0.try_into().unwrap();
let b: NonNaN = (-4.0).try_into().unwrap();
assert_eq!(a.abs(), 3.0);
assert_eq!(b.abs(), 4.0);
assert!(tf64::NEG_ZERO.abs().is_sign_positive());
assert_eq!(tf64::NEG_INFINITY.abs(), tf64::INFINITY);
See f64::abs()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn ceil(self) -> Positive<f64>
pub fn ceil(self) -> Positive<f64>
Returns the smallest integer greater than or equal to self
.
§Examples
let a: NonNaN = 3.5.try_into().unwrap();
let b: NonNaN = (-3.5).try_into().unwrap();
assert_eq!(a.ceil(), 4.0);
assert_eq!(b.ceil(), -3.0);
assert_eq!(tf64::INFINITY.ceil(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.ceil(), tf64::NEG_INFINITY);
See f64::ceil()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn floor(self) -> Positive<f64>
pub fn floor(self) -> Positive<f64>
Returns the largest integer less than or equal to self
.
§Examples
let a: NonNaN = 3.5.try_into().unwrap();
let b: NonNaN = (-3.5).try_into().unwrap();
assert_eq!(a.floor(), 3.0);
assert_eq!(b.floor(), -4.0);
assert_eq!(tf64::INFINITY.floor(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.floor(), tf64::NEG_INFINITY);
See f64::floor()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn round(self) -> Positive<f64>
pub fn round(self) -> Positive<f64>
Returns the nearest integer to self
. If a value is half-way between two
integers, round away from 0.0
.
§Examples
let a: NonNaN = 3.5.try_into().unwrap();
let b: NonNaN = (-3.5).try_into().unwrap();
assert_eq!(a.round(), 4.0);
assert_eq!(b.round(), -4.0);
assert_eq!(tf64::INFINITY.round(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.round(), tf64::NEG_INFINITY);
See f64::round()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn trunc(self) -> Positive<f64>
pub fn trunc(self) -> Positive<f64>
Returns the integer part of self
.
This means that non-integer numbers are always truncated towards zero.
§Examples
let a: NonNaN = 3.5.try_into().unwrap();
let b: NonNaN = (-3.5).try_into().unwrap();
assert_eq!(a.trunc(), 3.0);
assert_eq!(b.trunc(), -3.0);
assert_eq!(tf64::INFINITY.trunc(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.trunc(), tf64::NEG_INFINITY);
See f64::trunc()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn fract(self) -> f64
pub fn fract(self) -> f64
Returns the fractional part of self
.
For negative numbers, the result is negative except when the fractional part is zero.
For INIFINITY and NEG_INFINITY, the result is NaN.
§Examples
let a: NonNaNFinite = 3.5.try_into().unwrap();
let b: NonNaNFinite = (-3.5).try_into().unwrap();
let c: NonNaNFinite = (-3.0).try_into().unwrap();
assert_eq!(a.fract(), 0.5);
assert_eq!(b.fract(), -0.5);
assert_is_positive_zero!(c.fract());
assert_is_nan!(tf64::INFINITY.fract());
See f64::fract()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn signum(self) -> StrictlyPositiveFinite<f64>
pub fn signum(self) -> StrictlyPositiveFinite<f64>
Returns a number that represents the sign of self
.
1.0
if the number is positive,+0.0
orINFINITY
-1.0
if the number is negative,-0.0
orNEG_INFINITY
§Examples
let a: NonNaN = 3.5.try_into().unwrap();
let b: NonNaN = (-3.5).try_into().unwrap();
assert_eq!(a.signum(), 1.0);
assert_eq!(b.signum(), -1.0);
assert_eq!(tf64::ZERO.signum(), 1.0);
assert_eq!(tf64::NEG_ZERO.signum(), -1.0);
assert_eq!(tf64::INFINITY.signum(), 1.0);
assert_eq!(tf64::NEG_INFINITY.signum(), -1.0);
See f64::signum()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn sqrt(self) -> Positive<f64>
pub fn sqrt(self) -> Positive<f64>
Returns the square root of a number.
Returns NaN if self
is a negative number other than -0.0
.
Returns -0.0
if self
is -0.0
.
§Examples
let a: NonNaN = 25.0.try_into().unwrap();
let b: NonNaN = (-1).try_into().unwrap();
assert_eq!(a.sqrt(), 5.0);
assert_is_nan!(b.sqrt());
assert!(tf64::is_positive_zero(tf64::ZERO.sqrt().into()));
assert!(tf64::is_negative_zero(tf64::NEG_ZERO.sqrt()));
assert_eq!(tf64::INFINITY.sqrt(), tf64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.sqrt());
See f64::sqrt()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn exp(self) -> StrictlyPositive<f64>
pub fn exp(self) -> StrictlyPositive<f64>
Returns e^(self)
, (the exponential function).
§Examples
let a: NonNaN = 1.0.try_into().unwrap();
let b: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.exp(), core::f64::consts::E);
assert_eq!(b.exp(), 1.0 / core::f64::consts::E);
assert_eq!(tf64::ZERO.exp(), 1.0);
assert_eq!(tf64::NEG_ZERO.exp(), 1.0);
assert_eq!(tf64::INFINITY.exp(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.exp(), tf64::ZERO);
See f64::exp()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn exp2(self) -> StrictlyPositive<f64>
pub fn exp2(self) -> StrictlyPositive<f64>
Returns 2^(self)
.
§Examples
let a: NonNaN = 2.0.try_into().unwrap();
let b: NonNaN = (-2.0).try_into().unwrap();
assert_eq!(a.exp2(), 4.0);
assert_eq!(b.exp2(), 0.25);
assert_eq!(tf64::ZERO.exp2(), 1.0);
assert_eq!(tf64::NEG_ZERO.exp2(), 1.0);
assert_eq!(tf64::INFINITY.exp2(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.exp2(), tf64::ZERO);
See f64::exp2()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn ln(self) -> NonNaN<f64>
pub fn ln(self) -> NonNaN<f64>
Returns the natural logarithm of the number.
Returns NaN if self
is a negative number other than -0.0
.
§Examples
let a: NonNaN = 1.0.try_into().unwrap();
let b: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.ln(), 0.0);
assert_is_nan!(b.ln());
assert_eq!(tf64::ZERO.ln(), f64::NEG_INFINITY);
assert_eq!(tf64::NEG_ZERO.ln(), f64::NEG_INFINITY);
assert_eq!(tf64::INFINITY.ln(), tf64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.ln());
See f64::ln()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn log2(self) -> NonNaN<f64>
pub fn log2(self) -> NonNaN<f64>
Returns the base 2 logarithm of the number.
Returns NaN if self
is a negative number other than -0.0
.
§Examples
let a: NonNaN = 2.0.try_into().unwrap();
let b: NonNaN = 1.0.try_into().unwrap();
let c: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.log2(), 1.0);
assert!(tf64::is_positive_zero(b.log2()));
assert_is_nan!(c.log2());
assert_eq!(tf64::ZERO.log2(), f64::NEG_INFINITY);
assert_eq!(tf64::NEG_ZERO.log2(), f64::NEG_INFINITY);
assert_eq!(tf64::INFINITY.log2(), tf64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.log2());
See f64::log2()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn log10(self) -> NonNaN<f64>
pub fn log10(self) -> NonNaN<f64>
Returns the base 10 logarithm of the number.
Returns NaN if self
is a negative number other than -0.0
.
§Examples
let a: NonNaN = 100.0.try_into().unwrap();
let b: NonNaN = 1.0.try_into().unwrap();
let c: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.log10(), 2.0);
assert_eq!(b.log10(), 0.0);
assert_is_nan!(c.log10());
assert_eq!(tf64::ZERO.log10(), f64::NEG_INFINITY);
assert_eq!(tf64::NEG_ZERO.log10(), f64::NEG_INFINITY);
assert_eq!(tf64::INFINITY.log10(), tf64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.log10());
See f64::log10()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn to_degrees(self) -> Positive<f64>
pub fn to_degrees(self) -> Positive<f64>
Converts degrees to radians.
§Examples
let a: NonNaN = core::f64::consts::PI.try_into().unwrap();
let b: NonNaN = (-core::f64::consts::PI).try_into().unwrap();
let c: NonNaN = (2.0 * core::f64::consts::PI).try_into().unwrap();
assert_eq!(a.to_degrees(), 180.0);
assert_eq!(b.to_degrees(), -180.0);
assert_eq!(c.to_degrees(), 360.0);
assert_is_positive_zero!(tf64::ZERO.to_degrees());
assert_is_negative_zero!(tf64::NEG_ZERO.to_degrees());
assert_eq!(tf64::INFINITY.to_degrees(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.to_degrees(), tf64::NEG_INFINITY);
See f64::to_degrees()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn to_radians(self) -> Positive<f64>
pub fn to_radians(self) -> Positive<f64>
Converts degrees to radians.
§Examples
let a: NonNaN = 180.0.try_into().unwrap();
let b: NonNaN = 0.0.try_into().unwrap();
let c: NonNaN = (-180.0).try_into().unwrap();
let d: NonNaN = 360.0.try_into().unwrap();
assert_eq!(a.to_radians(), core::f64::consts::PI);
assert_eq!(b.to_radians(), 0.0);
assert_eq!(c.to_radians(), -core::f64::consts::PI);
assert_eq!(d.to_radians(), 2.0 * core::f64::consts::PI);
assert_eq!(tf64::INFINITY.to_radians(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.to_radians(), tf64::NEG_INFINITY);
See f64::to_radians()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn cbrt(self) -> Positive<f64>
pub fn cbrt(self) -> Positive<f64>
Returns the cube root of a number.
The result will be finite unless the argument is infinite.
§Examples
let a: NonNaN = 8.0.try_into().unwrap();
let b: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.cbrt(), 2.0);
assert_eq!(b.cbrt(), -1.0);
assert_eq!(tf64::ZERO.cbrt(), tf64::ZERO);
assert_eq!(tf64::NEG_ZERO.cbrt(), tf64::NEG_ZERO);
assert_eq!(tf64::INFINITY.cbrt(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.cbrt(), tf64::NEG_INFINITY);
See f64::cbrt()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn sin(self) -> f64
pub fn sin(self) -> f64
Computes the sine of a number (in radians).
The result will be in the range [-1, 1] if the input is finite, and NaN if the input is infinite.
§Examples
let a: NonNaNFinite = core::f64::consts::PI.try_into().unwrap();
let b: NonNaNFinite = 0.0.try_into().unwrap();
let c: NonNaNFinite = (-0.0).try_into().unwrap();
let d: NonNaNFinite = (-core::f64::consts::PI).try_into().unwrap();
let e: NonNaNFinite = core::f64::consts::FRAC_PI_2.try_into().unwrap();
let f: NonNaNFinite = (-core::f64::consts::FRAC_PI_2).try_into().unwrap();
assert_relative_eq!(a.sin().get(), 0.0);
assert_relative_eq!(b.sin().get(), 0.0);
assert_relative_eq!(c.sin().get(), 0.0);
assert_relative_eq!(d.sin().get(), 0.0);
assert_relative_eq!(e.sin().get(), 1.0);
assert_relative_eq!(f.sin().get(), -1.0);
assert_is_nan!(tf64::INFINITY.sin());
assert_is_nan!(tf64::NEG_INFINITY.sin());
See f64::sin()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn cos(self) -> f64
pub fn cos(self) -> f64
Computes the cosine of a number (in radians).
The result will be in the range [-1, 1] if the input is finite, and NaN if the input is infinite.
§Examples
let a: NonNaNFinite = core::f64::consts::PI.try_into().unwrap();
let b: NonNaNFinite = 0.0.try_into().unwrap();
let c: NonNaNFinite = (-0.0).try_into().unwrap();
let d: NonNaNFinite = (-core::f64::consts::PI).try_into().unwrap();
let e: NonNaNFinite = core::f64::consts::FRAC_PI_2.try_into().unwrap();
let f: NonNaNFinite = (-core::f64::consts::FRAC_PI_2).try_into().unwrap();
assert_relative_eq!(a.cos().get(), -1.0);
assert_relative_eq!(b.cos().get(), 1.0);
assert_relative_eq!(c.cos().get(), 1.0);
assert_relative_eq!(d.cos().get(), -1.0);
assert_relative_eq!(e.cos().get(), 0.0);
assert_relative_eq!(f.cos().get(), 0.0);
assert_is_nan!(tf64::INFINITY.cos());
assert_is_nan!(tf64::NEG_INFINITY.cos());
See f64::cos()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn tan(self) -> f64
pub fn tan(self) -> f64
Computes the tangent of a number (in radians).
The result NaN if the input is infinite.
§Examples
assert_eq!(tf64::ZERO.tan(), 0.0);
assert_relative_eq!(tf64::consts::FRAC_PI_4.tan().get(), 1.0);
assert_is_nan!(tf64::INFINITY.tan());
assert_is_nan!(tf64::NEG_INFINITY.tan());
See f64::tan()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn asin(self) -> f64
pub fn asin(self) -> f64
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].
§Examples
let a: NonNaN = 2.0.try_into().unwrap();
let b: NonNaN = (-2.0).try_into().unwrap();
assert_is_nan!(a.asin());
assert_is_nan!(b.asin());
assert!(tf64::is_positive_zero(tf64::ZERO.asin()));
assert!(tf64::is_negative_zero(tf64::NEG_ZERO.asin()));
assert_is_nan!(tf64::INFINITY.asin());
assert_is_nan!(tf64::NEG_INFINITY.asin());
See f64::asin()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn acos(self) -> f64
pub fn acos(self) -> f64
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].
§Examples
let a: NonNaN = 2.0.try_into().unwrap();
let b: NonNaN = (-2.0).try_into().unwrap();
let c: NonNaN = (-1).try_into().unwrap();
let d: NonNaN = 1.try_into().unwrap();
assert_is_nan!(a.acos());
assert_is_nan!(b.acos());
assert_relative_eq!(c.acos(), core::f64::consts::PI);
assert_relative_eq!(d.acos(), 0.0);
assert_relative_eq!(tf64::ZERO.acos(), core::f64::consts::FRAC_PI_2);
assert_is_nan!(tf64::INFINITY.acos());
assert_is_nan!(tf64::NEG_INFINITY.acos());
See f64::acos()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn atan(self) -> PositiveFinite<f64>
pub fn atan(self) -> PositiveFinite<f64>
Computes the arctangent of a number.
Return value is in radians in the range [-pi/2, pi/2];
§Examples
assert_is_positive_zero!(tf64::ZERO.atan());
assert_is_negative_zero!(tf64::NEG_ZERO.atan());
assert_relative_eq!(tf64::INFINITY.atan().get(), core::f64::consts::FRAC_PI_2);
assert_relative_eq!(tf64::NEG_INFINITY.atan().get(), -core::f64::consts::FRAC_PI_2);
See f64::atan()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn exp_m1(self) -> Positive<f64>
pub fn exp_m1(self) -> Positive<f64>
Returns e^(self) - 1
in a way that is accurate even if the number is close to zero.
§Examples
assert_is_positive_zero!(tf64::ZERO.exp_m1());
assert_is_negative_zero!(tf64::NEG_ZERO.exp_m1());
assert_eq!(tf64::INFINITY.exp_m1(), f64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.exp_m1(), -1.0);
See f64::exp_m1()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn ln_1p(self) -> Positive<f64>
pub fn ln_1p(self) -> Positive<f64>
Returns ln(1+n)
(natural logarithm) more accurately than if the operations were performed separately.
§Examples
let a: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.ln_1p(), f64::NEG_INFINITY);
assert!(tf64::is_positive_zero(tf64::ZERO.ln_1p().get()));
assert!(tf64::is_negative_zero(tf64::NEG_ZERO.ln_1p()));
assert_eq!(tf64::INFINITY.ln_1p(), f64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.ln_1p());
See f64::ln_1p()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn sinh(self) -> Positive<f64>
pub fn sinh(self) -> Positive<f64>
Hyperbolic sine function.
§Examples
assert_is_positive_zero!(tf64::ZERO.sinh());
assert_is_negative_zero!(tf64::NEG_ZERO.sinh());
assert_eq!(tf64::INFINITY.sinh(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.sinh(), tf64::NEG_INFINITY);
See f64::sinh()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn cosh(self) -> StrictlyPositive<f64>
pub fn cosh(self) -> StrictlyPositive<f64>
Hyperbolic cosine function.
§Examples
assert_eq!(tf64::ZERO.cosh(), 1.0);
assert_eq!(tf64::NEG_ZERO.cosh(), 1.0);
assert_eq!(tf64::INFINITY.cosh(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.cosh(), tf64::INFINITY);
See f64::cosh()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn tanh(self) -> PositiveFinite<f64>
pub fn tanh(self) -> PositiveFinite<f64>
Hyperbolic tangent function.
§Examples
assert_is_positive_zero!(tf64::ZERO.tanh());
assert_is_negative_zero!(tf64::NEG_ZERO.tanh());
assert_eq!(tf64::INFINITY.tanh(), 1.0);
assert_eq!(tf64::NEG_INFINITY.tanh(), -1.0);
See f64::tanh()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn asinh(self) -> Positive<f64>
pub fn asinh(self) -> Positive<f64>
Inverse hyperbolic sine function.
§Examples
assert_is_positive_zero!(tf64::ZERO.asinh());
assert_is_negative_zero!(tf64::NEG_ZERO.asinh());
assert_eq!(tf64::INFINITY.asinh(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.asinh(), tf64::NEG_INFINITY);
See f64::asinh()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn acosh(self) -> f64
pub fn acosh(self) -> f64
Inverse hyperbolic cosine function.
§Examples
let a: NonNaN = 1.0.try_into().unwrap();
assert_is_positive_zero!(a.acosh());
assert_is_nan!(tf64::ZERO.acosh());
assert_eq!(tf64::INFINITY.acosh(), tf64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.acosh());
See f64::acosh()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn atanh(self) -> f64
pub fn atanh(self) -> f64
Inverse hyperbolic tangent function.
§Examples
let a: NonNaN = 1.0.try_into().unwrap();
let b: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.atanh(), tf64::INFINITY);
assert_eq!(b.atanh(), tf64::NEG_INFINITY);
assert_is_positive_zero!(tf64::ZERO.atanh());
assert_is_negative_zero!(tf64::NEG_ZERO.atanh());
assert_is_nan!(tf64::INFINITY.atanh());
assert_is_nan!(tf64::NEG_INFINITY.atanh());
See f64::atanh()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn recip(self) -> Positive<f64>
pub fn recip(self) -> Positive<f64>
Takes the reciprocal (inverse) of a number, 1/x
.
§Examples
let a: NonNaN = 1.0.try_into().unwrap();
let b: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.recip(), 1.0);
assert_eq!(b.recip(), -1.0);
assert_eq!(tf64::ZERO.recip(), tf64::INFINITY);
assert_eq!(tf64::NEG_ZERO.recip(), tf64::NEG_INFINITY);
assert_is_positive_zero!(tf64::INFINITY.recip());
assert_is_negative_zero!(tf64::NEG_INFINITY.recip());
See f64::recip()
for more details.
source§impl Positive<f64>
impl Positive<f64>
sourcepub fn powi(self, n: i32) -> Positive<f64>
pub fn powi(self, n: i32) -> Positive<f64>
Raises a number to an integer power.
Using this function is generally faster than using powf
.
It might have a different sequence of rounding operations than powf
,
so the results are not guaranteed to agree.
§Examples
let x: NonNaN = (-2.0).try_into().unwrap();
assert_eq!(x.powi(3), -8.0);
assert_eq!(x.powi(2), 4.0);
assert_eq!(x.powi(1), -2.0);
assert_eq!(x.powi(0), 1.0);
assert_eq!(x.powi(-1), -0.5);
assert_eq!(x.powi(-2), 0.25);
assert_eq!(x.powi(-3), -0.125);
See f64::powi()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn abs(self) -> Positive<f32>
pub fn abs(self) -> Positive<f32>
Computes the absolute value of self
.
§Examples
let a: NonNaN = 3.0.try_into().unwrap();
let b: NonNaN = (-4.0).try_into().unwrap();
assert_eq!(a.abs(), 3.0);
assert_eq!(b.abs(), 4.0);
assert!(tf64::NEG_ZERO.abs().is_sign_positive());
assert_eq!(tf64::NEG_INFINITY.abs(), tf64::INFINITY);
See f64::abs()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn ceil(self) -> Positive<f32>
pub fn ceil(self) -> Positive<f32>
Returns the smallest integer greater than or equal to self
.
§Examples
let a: NonNaN = 3.5.try_into().unwrap();
let b: NonNaN = (-3.5).try_into().unwrap();
assert_eq!(a.ceil(), 4.0);
assert_eq!(b.ceil(), -3.0);
assert_eq!(tf64::INFINITY.ceil(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.ceil(), tf64::NEG_INFINITY);
See f64::ceil()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn floor(self) -> Positive<f32>
pub fn floor(self) -> Positive<f32>
Returns the largest integer less than or equal to self
.
§Examples
let a: NonNaN = 3.5.try_into().unwrap();
let b: NonNaN = (-3.5).try_into().unwrap();
assert_eq!(a.floor(), 3.0);
assert_eq!(b.floor(), -4.0);
assert_eq!(tf64::INFINITY.floor(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.floor(), tf64::NEG_INFINITY);
See f64::floor()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn round(self) -> Positive<f32>
pub fn round(self) -> Positive<f32>
Returns the nearest integer to self
. If a value is half-way between two
integers, round away from 0.0
.
§Examples
let a: NonNaN = 3.5.try_into().unwrap();
let b: NonNaN = (-3.5).try_into().unwrap();
assert_eq!(a.round(), 4.0);
assert_eq!(b.round(), -4.0);
assert_eq!(tf64::INFINITY.round(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.round(), tf64::NEG_INFINITY);
See f64::round()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn trunc(self) -> Positive<f32>
pub fn trunc(self) -> Positive<f32>
Returns the integer part of self
.
This means that non-integer numbers are always truncated towards zero.
§Examples
let a: NonNaN = 3.5.try_into().unwrap();
let b: NonNaN = (-3.5).try_into().unwrap();
assert_eq!(a.trunc(), 3.0);
assert_eq!(b.trunc(), -3.0);
assert_eq!(tf64::INFINITY.trunc(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.trunc(), tf64::NEG_INFINITY);
See f64::trunc()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn fract(self) -> f32
pub fn fract(self) -> f32
Returns the fractional part of self
.
For negative numbers, the result is negative except when the fractional part is zero.
For INIFINITY and NEG_INFINITY, the result is NaN.
§Examples
let a: NonNaNFinite = 3.5.try_into().unwrap();
let b: NonNaNFinite = (-3.5).try_into().unwrap();
let c: NonNaNFinite = (-3.0).try_into().unwrap();
assert_eq!(a.fract(), 0.5);
assert_eq!(b.fract(), -0.5);
assert_is_positive_zero!(c.fract());
assert_is_nan!(tf64::INFINITY.fract());
See f64::fract()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn signum(self) -> StrictlyPositiveFinite<f32>
pub fn signum(self) -> StrictlyPositiveFinite<f32>
Returns a number that represents the sign of self
.
1.0
if the number is positive,+0.0
orINFINITY
-1.0
if the number is negative,-0.0
orNEG_INFINITY
§Examples
let a: NonNaN = 3.5.try_into().unwrap();
let b: NonNaN = (-3.5).try_into().unwrap();
assert_eq!(a.signum(), 1.0);
assert_eq!(b.signum(), -1.0);
assert_eq!(tf64::ZERO.signum(), 1.0);
assert_eq!(tf64::NEG_ZERO.signum(), -1.0);
assert_eq!(tf64::INFINITY.signum(), 1.0);
assert_eq!(tf64::NEG_INFINITY.signum(), -1.0);
See f64::signum()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn sqrt(self) -> Positive<f32>
pub fn sqrt(self) -> Positive<f32>
Returns the square root of a number.
Returns NaN if self
is a negative number other than -0.0
.
Returns -0.0
if self
is -0.0
.
§Examples
let a: NonNaN = 25.0.try_into().unwrap();
let b: NonNaN = (-1).try_into().unwrap();
assert_eq!(a.sqrt(), 5.0);
assert_is_nan!(b.sqrt());
assert!(tf64::is_positive_zero(tf64::ZERO.sqrt().into()));
assert!(tf64::is_negative_zero(tf64::NEG_ZERO.sqrt()));
assert_eq!(tf64::INFINITY.sqrt(), tf64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.sqrt());
See f64::sqrt()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn exp(self) -> StrictlyPositive<f32>
pub fn exp(self) -> StrictlyPositive<f32>
Returns e^(self)
, (the exponential function).
§Examples
let a: NonNaN = 1.0.try_into().unwrap();
let b: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.exp(), core::f64::consts::E);
assert_eq!(b.exp(), 1.0 / core::f64::consts::E);
assert_eq!(tf64::ZERO.exp(), 1.0);
assert_eq!(tf64::NEG_ZERO.exp(), 1.0);
assert_eq!(tf64::INFINITY.exp(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.exp(), tf64::ZERO);
See f64::exp()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn exp2(self) -> StrictlyPositive<f32>
pub fn exp2(self) -> StrictlyPositive<f32>
Returns 2^(self)
.
§Examples
let a: NonNaN = 2.0.try_into().unwrap();
let b: NonNaN = (-2.0).try_into().unwrap();
assert_eq!(a.exp2(), 4.0);
assert_eq!(b.exp2(), 0.25);
assert_eq!(tf64::ZERO.exp2(), 1.0);
assert_eq!(tf64::NEG_ZERO.exp2(), 1.0);
assert_eq!(tf64::INFINITY.exp2(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.exp2(), tf64::ZERO);
See f64::exp2()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn ln(self) -> NonNaN<f32>
pub fn ln(self) -> NonNaN<f32>
Returns the natural logarithm of the number.
Returns NaN if self
is a negative number other than -0.0
.
§Examples
let a: NonNaN = 1.0.try_into().unwrap();
let b: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.ln(), 0.0);
assert_is_nan!(b.ln());
assert_eq!(tf64::ZERO.ln(), f64::NEG_INFINITY);
assert_eq!(tf64::NEG_ZERO.ln(), f64::NEG_INFINITY);
assert_eq!(tf64::INFINITY.ln(), tf64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.ln());
See f64::ln()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn log2(self) -> NonNaN<f32>
pub fn log2(self) -> NonNaN<f32>
Returns the base 2 logarithm of the number.
Returns NaN if self
is a negative number other than -0.0
.
§Examples
let a: NonNaN = 2.0.try_into().unwrap();
let b: NonNaN = 1.0.try_into().unwrap();
let c: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.log2(), 1.0);
assert!(tf64::is_positive_zero(b.log2()));
assert_is_nan!(c.log2());
assert_eq!(tf64::ZERO.log2(), f64::NEG_INFINITY);
assert_eq!(tf64::NEG_ZERO.log2(), f64::NEG_INFINITY);
assert_eq!(tf64::INFINITY.log2(), tf64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.log2());
See f64::log2()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn log10(self) -> NonNaN<f32>
pub fn log10(self) -> NonNaN<f32>
Returns the base 10 logarithm of the number.
Returns NaN if self
is a negative number other than -0.0
.
§Examples
let a: NonNaN = 100.0.try_into().unwrap();
let b: NonNaN = 1.0.try_into().unwrap();
let c: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.log10(), 2.0);
assert_eq!(b.log10(), 0.0);
assert_is_nan!(c.log10());
assert_eq!(tf64::ZERO.log10(), f64::NEG_INFINITY);
assert_eq!(tf64::NEG_ZERO.log10(), f64::NEG_INFINITY);
assert_eq!(tf64::INFINITY.log10(), tf64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.log10());
See f64::log10()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn to_degrees(self) -> Positive<f32>
pub fn to_degrees(self) -> Positive<f32>
Converts degrees to radians.
§Examples
let a: NonNaN = core::f64::consts::PI.try_into().unwrap();
let b: NonNaN = (-core::f64::consts::PI).try_into().unwrap();
let c: NonNaN = (2.0 * core::f64::consts::PI).try_into().unwrap();
assert_eq!(a.to_degrees(), 180.0);
assert_eq!(b.to_degrees(), -180.0);
assert_eq!(c.to_degrees(), 360.0);
assert_is_positive_zero!(tf64::ZERO.to_degrees());
assert_is_negative_zero!(tf64::NEG_ZERO.to_degrees());
assert_eq!(tf64::INFINITY.to_degrees(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.to_degrees(), tf64::NEG_INFINITY);
See f64::to_degrees()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn to_radians(self) -> Positive<f32>
pub fn to_radians(self) -> Positive<f32>
Converts degrees to radians.
§Examples
let a: NonNaN = 180.0.try_into().unwrap();
let b: NonNaN = 0.0.try_into().unwrap();
let c: NonNaN = (-180.0).try_into().unwrap();
let d: NonNaN = 360.0.try_into().unwrap();
assert_eq!(a.to_radians(), core::f64::consts::PI);
assert_eq!(b.to_radians(), 0.0);
assert_eq!(c.to_radians(), -core::f64::consts::PI);
assert_eq!(d.to_radians(), 2.0 * core::f64::consts::PI);
assert_eq!(tf64::INFINITY.to_radians(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.to_radians(), tf64::NEG_INFINITY);
See f64::to_radians()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn cbrt(self) -> Positive<f32>
pub fn cbrt(self) -> Positive<f32>
Returns the cube root of a number.
The result will be finite unless the argument is infinite.
§Examples
let a: NonNaN = 8.0.try_into().unwrap();
let b: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.cbrt(), 2.0);
assert_eq!(b.cbrt(), -1.0);
assert_eq!(tf64::ZERO.cbrt(), tf64::ZERO);
assert_eq!(tf64::NEG_ZERO.cbrt(), tf64::NEG_ZERO);
assert_eq!(tf64::INFINITY.cbrt(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.cbrt(), tf64::NEG_INFINITY);
See f64::cbrt()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn sin(self) -> f32
pub fn sin(self) -> f32
Computes the sine of a number (in radians).
The result will be in the range [-1, 1] if the input is finite, and NaN if the input is infinite.
§Examples
let a: NonNaNFinite = core::f64::consts::PI.try_into().unwrap();
let b: NonNaNFinite = 0.0.try_into().unwrap();
let c: NonNaNFinite = (-0.0).try_into().unwrap();
let d: NonNaNFinite = (-core::f64::consts::PI).try_into().unwrap();
let e: NonNaNFinite = core::f64::consts::FRAC_PI_2.try_into().unwrap();
let f: NonNaNFinite = (-core::f64::consts::FRAC_PI_2).try_into().unwrap();
assert_relative_eq!(a.sin().get(), 0.0);
assert_relative_eq!(b.sin().get(), 0.0);
assert_relative_eq!(c.sin().get(), 0.0);
assert_relative_eq!(d.sin().get(), 0.0);
assert_relative_eq!(e.sin().get(), 1.0);
assert_relative_eq!(f.sin().get(), -1.0);
assert_is_nan!(tf64::INFINITY.sin());
assert_is_nan!(tf64::NEG_INFINITY.sin());
See f64::sin()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn cos(self) -> f32
pub fn cos(self) -> f32
Computes the cosine of a number (in radians).
The result will be in the range [-1, 1] if the input is finite, and NaN if the input is infinite.
§Examples
let a: NonNaNFinite = core::f64::consts::PI.try_into().unwrap();
let b: NonNaNFinite = 0.0.try_into().unwrap();
let c: NonNaNFinite = (-0.0).try_into().unwrap();
let d: NonNaNFinite = (-core::f64::consts::PI).try_into().unwrap();
let e: NonNaNFinite = core::f64::consts::FRAC_PI_2.try_into().unwrap();
let f: NonNaNFinite = (-core::f64::consts::FRAC_PI_2).try_into().unwrap();
assert_relative_eq!(a.cos().get(), -1.0);
assert_relative_eq!(b.cos().get(), 1.0);
assert_relative_eq!(c.cos().get(), 1.0);
assert_relative_eq!(d.cos().get(), -1.0);
assert_relative_eq!(e.cos().get(), 0.0);
assert_relative_eq!(f.cos().get(), 0.0);
assert_is_nan!(tf64::INFINITY.cos());
assert_is_nan!(tf64::NEG_INFINITY.cos());
See f64::cos()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn tan(self) -> f32
pub fn tan(self) -> f32
Computes the tangent of a number (in radians).
The result NaN if the input is infinite.
§Examples
assert_eq!(tf64::ZERO.tan(), 0.0);
assert_relative_eq!(tf64::consts::FRAC_PI_4.tan().get(), 1.0);
assert_is_nan!(tf64::INFINITY.tan());
assert_is_nan!(tf64::NEG_INFINITY.tan());
See f64::tan()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn asin(self) -> f32
pub fn asin(self) -> f32
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].
§Examples
let a: NonNaN = 2.0.try_into().unwrap();
let b: NonNaN = (-2.0).try_into().unwrap();
assert_is_nan!(a.asin());
assert_is_nan!(b.asin());
assert!(tf64::is_positive_zero(tf64::ZERO.asin()));
assert!(tf64::is_negative_zero(tf64::NEG_ZERO.asin()));
assert_is_nan!(tf64::INFINITY.asin());
assert_is_nan!(tf64::NEG_INFINITY.asin());
See f64::asin()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn acos(self) -> f32
pub fn acos(self) -> f32
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].
§Examples
let a: NonNaN = 2.0.try_into().unwrap();
let b: NonNaN = (-2.0).try_into().unwrap();
let c: NonNaN = (-1).try_into().unwrap();
let d: NonNaN = 1.try_into().unwrap();
assert_is_nan!(a.acos());
assert_is_nan!(b.acos());
assert_relative_eq!(c.acos(), core::f64::consts::PI);
assert_relative_eq!(d.acos(), 0.0);
assert_relative_eq!(tf64::ZERO.acos(), core::f64::consts::FRAC_PI_2);
assert_is_nan!(tf64::INFINITY.acos());
assert_is_nan!(tf64::NEG_INFINITY.acos());
See f64::acos()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn atan(self) -> PositiveFinite<f32>
pub fn atan(self) -> PositiveFinite<f32>
Computes the arctangent of a number.
Return value is in radians in the range [-pi/2, pi/2];
§Examples
assert_is_positive_zero!(tf64::ZERO.atan());
assert_is_negative_zero!(tf64::NEG_ZERO.atan());
assert_relative_eq!(tf64::INFINITY.atan().get(), core::f64::consts::FRAC_PI_2);
assert_relative_eq!(tf64::NEG_INFINITY.atan().get(), -core::f64::consts::FRAC_PI_2);
See f64::atan()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn exp_m1(self) -> Positive<f32>
pub fn exp_m1(self) -> Positive<f32>
Returns e^(self) - 1
in a way that is accurate even if the number is close to zero.
§Examples
assert_is_positive_zero!(tf64::ZERO.exp_m1());
assert_is_negative_zero!(tf64::NEG_ZERO.exp_m1());
assert_eq!(tf64::INFINITY.exp_m1(), f64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.exp_m1(), -1.0);
See f64::exp_m1()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn ln_1p(self) -> Positive<f32>
pub fn ln_1p(self) -> Positive<f32>
Returns ln(1+n)
(natural logarithm) more accurately than if the operations were performed separately.
§Examples
let a: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.ln_1p(), f64::NEG_INFINITY);
assert!(tf64::is_positive_zero(tf64::ZERO.ln_1p().get()));
assert!(tf64::is_negative_zero(tf64::NEG_ZERO.ln_1p()));
assert_eq!(tf64::INFINITY.ln_1p(), f64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.ln_1p());
See f64::ln_1p()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn sinh(self) -> Positive<f32>
pub fn sinh(self) -> Positive<f32>
Hyperbolic sine function.
§Examples
assert_is_positive_zero!(tf64::ZERO.sinh());
assert_is_negative_zero!(tf64::NEG_ZERO.sinh());
assert_eq!(tf64::INFINITY.sinh(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.sinh(), tf64::NEG_INFINITY);
See f64::sinh()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn cosh(self) -> StrictlyPositive<f32>
pub fn cosh(self) -> StrictlyPositive<f32>
Hyperbolic cosine function.
§Examples
assert_eq!(tf64::ZERO.cosh(), 1.0);
assert_eq!(tf64::NEG_ZERO.cosh(), 1.0);
assert_eq!(tf64::INFINITY.cosh(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.cosh(), tf64::INFINITY);
See f64::cosh()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn tanh(self) -> PositiveFinite<f32>
pub fn tanh(self) -> PositiveFinite<f32>
Hyperbolic tangent function.
§Examples
assert_is_positive_zero!(tf64::ZERO.tanh());
assert_is_negative_zero!(tf64::NEG_ZERO.tanh());
assert_eq!(tf64::INFINITY.tanh(), 1.0);
assert_eq!(tf64::NEG_INFINITY.tanh(), -1.0);
See f64::tanh()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn asinh(self) -> Positive<f32>
pub fn asinh(self) -> Positive<f32>
Inverse hyperbolic sine function.
§Examples
assert_is_positive_zero!(tf64::ZERO.asinh());
assert_is_negative_zero!(tf64::NEG_ZERO.asinh());
assert_eq!(tf64::INFINITY.asinh(), tf64::INFINITY);
assert_eq!(tf64::NEG_INFINITY.asinh(), tf64::NEG_INFINITY);
See f64::asinh()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn acosh(self) -> f32
pub fn acosh(self) -> f32
Inverse hyperbolic cosine function.
§Examples
let a: NonNaN = 1.0.try_into().unwrap();
assert_is_positive_zero!(a.acosh());
assert_is_nan!(tf64::ZERO.acosh());
assert_eq!(tf64::INFINITY.acosh(), tf64::INFINITY);
assert_is_nan!(tf64::NEG_INFINITY.acosh());
See f64::acosh()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn atanh(self) -> f32
pub fn atanh(self) -> f32
Inverse hyperbolic tangent function.
§Examples
let a: NonNaN = 1.0.try_into().unwrap();
let b: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.atanh(), tf64::INFINITY);
assert_eq!(b.atanh(), tf64::NEG_INFINITY);
assert_is_positive_zero!(tf64::ZERO.atanh());
assert_is_negative_zero!(tf64::NEG_ZERO.atanh());
assert_is_nan!(tf64::INFINITY.atanh());
assert_is_nan!(tf64::NEG_INFINITY.atanh());
See f64::atanh()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn recip(self) -> Positive<f32>
pub fn recip(self) -> Positive<f32>
Takes the reciprocal (inverse) of a number, 1/x
.
§Examples
let a: NonNaN = 1.0.try_into().unwrap();
let b: NonNaN = (-1.0).try_into().unwrap();
assert_eq!(a.recip(), 1.0);
assert_eq!(b.recip(), -1.0);
assert_eq!(tf64::ZERO.recip(), tf64::INFINITY);
assert_eq!(tf64::NEG_ZERO.recip(), tf64::NEG_INFINITY);
assert_is_positive_zero!(tf64::INFINITY.recip());
assert_is_negative_zero!(tf64::NEG_INFINITY.recip());
See f64::recip()
for more details.
source§impl Positive<f32>
impl Positive<f32>
sourcepub fn powi(self, n: i32) -> Positive<f32>
pub fn powi(self, n: i32) -> Positive<f32>
Raises a number to an integer power.
Using this function is generally faster than using powf
.
It might have a different sequence of rounding operations than powf
,
so the results are not guaranteed to agree.
§Examples
let x: NonNaN = (-2.0).try_into().unwrap();
assert_eq!(x.powi(3), -8.0);
assert_eq!(x.powi(2), 4.0);
assert_eq!(x.powi(1), -2.0);
assert_eq!(x.powi(0), 1.0);
assert_eq!(x.powi(-1), -0.5);
assert_eq!(x.powi(-2), 0.25);
assert_eq!(x.powi(-3), -0.125);
See f64::powi()
for more details.
Trait Implementations§
source§impl AddAssign<PositiveFinite<f32>> for Positive<f32>
impl AddAssign<PositiveFinite<f32>> for Positive<f32>
source§fn add_assign(&mut self, rhs: PositiveFinite<f32>)
fn add_assign(&mut self, rhs: PositiveFinite<f32>)
+=
operation. Read moresource§impl AddAssign<PositiveFinite> for Positive<f64>
impl AddAssign<PositiveFinite> for Positive<f64>
source§fn add_assign(&mut self, rhs: PositiveFinite<f64>)
fn add_assign(&mut self, rhs: PositiveFinite<f64>)
+=
operation. Read moresource§impl AddAssign<StrictlyPositive<f32>> for Positive<f32>
impl AddAssign<StrictlyPositive<f32>> for Positive<f32>
source§fn add_assign(&mut self, rhs: StrictlyPositive<f32>)
fn add_assign(&mut self, rhs: StrictlyPositive<f32>)
+=
operation. Read moresource§impl AddAssign<StrictlyPositive> for Positive<f64>
impl AddAssign<StrictlyPositive> for Positive<f64>
source§fn add_assign(&mut self, rhs: StrictlyPositive<f64>)
fn add_assign(&mut self, rhs: StrictlyPositive<f64>)
+=
operation. Read moresource§impl AddAssign<StrictlyPositiveFinite<f32>> for Positive<f32>
impl AddAssign<StrictlyPositiveFinite<f32>> for Positive<f32>
source§fn add_assign(&mut self, rhs: StrictlyPositiveFinite<f32>)
fn add_assign(&mut self, rhs: StrictlyPositiveFinite<f32>)
+=
operation. Read moresource§impl AddAssign<StrictlyPositiveFinite> for Positive<f64>
impl AddAssign<StrictlyPositiveFinite> for Positive<f64>
source§fn add_assign(&mut self, rhs: StrictlyPositiveFinite<f64>)
fn add_assign(&mut self, rhs: StrictlyPositiveFinite<f64>)
+=
operation. Read moresource§impl Atan2<NegativeFinite<f32>> for Positive<f32>
impl Atan2<NegativeFinite<f32>> for Positive<f32>
source§type Output = NonNaNFinite<f32>
type Output = NonNaNFinite<f32>
Atan2::atan2()
.source§impl Atan2<NegativeFinite> for Positive<f64>
impl Atan2<NegativeFinite> for Positive<f64>
source§type Output = NonNaNFinite
type Output = NonNaNFinite
Atan2::atan2()
.source§impl Atan2<NonNaNFinite<f32>> for Positive<f32>
impl Atan2<NonNaNFinite<f32>> for Positive<f32>
source§type Output = NonNaNFinite<f32>
type Output = NonNaNFinite<f32>
Atan2::atan2()
.source§impl Atan2<NonNaNFinite> for Positive<f64>
impl Atan2<NonNaNFinite> for Positive<f64>
source§type Output = NonNaNFinite
type Output = NonNaNFinite
Atan2::atan2()
.source§impl Atan2<NonZeroNonNaN<f32>> for Positive<f32>
impl Atan2<NonZeroNonNaN<f32>> for Positive<f32>
source§type Output = NonNaNFinite<f32>
type Output = NonNaNFinite<f32>
Atan2::atan2()
.source§impl Atan2<NonZeroNonNaN> for Positive<f64>
impl Atan2<NonZeroNonNaN> for Positive<f64>
source§type Output = NonNaNFinite
type Output = NonNaNFinite
Atan2::atan2()
.source§impl Atan2<NonZeroNonNaNFinite<f32>> for Positive<f32>
impl Atan2<NonZeroNonNaNFinite<f32>> for Positive<f32>
source§type Output = NonNaNFinite<f32>
type Output = NonNaNFinite<f32>
Atan2::atan2()
.source§impl Atan2<NonZeroNonNaNFinite> for Positive<f64>
impl Atan2<NonZeroNonNaNFinite> for Positive<f64>
source§type Output = NonNaNFinite
type Output = NonNaNFinite
Atan2::atan2()
.source§impl Atan2<PositiveFinite<f32>> for Positive<f32>
impl Atan2<PositiveFinite<f32>> for Positive<f32>
source§type Output = PositiveFinite<f32>
type Output = PositiveFinite<f32>
Atan2::atan2()
.source§impl Atan2<PositiveFinite> for Positive<f64>
impl Atan2<PositiveFinite> for Positive<f64>
source§type Output = PositiveFinite
type Output = PositiveFinite
Atan2::atan2()
.source§impl Atan2<StrictlyNegative<f32>> for Positive<f32>
impl Atan2<StrictlyNegative<f32>> for Positive<f32>
source§type Output = NonNaNFinite<f32>
type Output = NonNaNFinite<f32>
Atan2::atan2()
.source§impl Atan2<StrictlyNegative> for Positive<f64>
impl Atan2<StrictlyNegative> for Positive<f64>
source§type Output = NonNaNFinite
type Output = NonNaNFinite
Atan2::atan2()
.source§impl Atan2<StrictlyNegativeFinite<f32>> for Positive<f32>
impl Atan2<StrictlyNegativeFinite<f32>> for Positive<f32>
source§type Output = NonNaNFinite<f32>
type Output = NonNaNFinite<f32>
Atan2::atan2()
.source§impl Atan2<StrictlyNegativeFinite> for Positive<f64>
impl Atan2<StrictlyNegativeFinite> for Positive<f64>
source§type Output = NonNaNFinite
type Output = NonNaNFinite
Atan2::atan2()
.source§impl Atan2<StrictlyPositive<f32>> for Positive<f32>
impl Atan2<StrictlyPositive<f32>> for Positive<f32>
source§type Output = PositiveFinite<f32>
type Output = PositiveFinite<f32>
Atan2::atan2()
.source§impl Atan2<StrictlyPositive> for Positive<f64>
impl Atan2<StrictlyPositive> for Positive<f64>
source§type Output = PositiveFinite
type Output = PositiveFinite
Atan2::atan2()
.source§impl Atan2<StrictlyPositiveFinite<f32>> for Positive<f32>
impl Atan2<StrictlyPositiveFinite<f32>> for Positive<f32>
source§type Output = PositiveFinite<f32>
type Output = PositiveFinite<f32>
Atan2::atan2()
.source§impl Atan2<StrictlyPositiveFinite> for Positive<f64>
impl Atan2<StrictlyPositiveFinite> for Positive<f64>
source§type Output = PositiveFinite
type Output = PositiveFinite
Atan2::atan2()
.source§impl Copysign<Negative> for Positive<f64>
impl Copysign<Negative> for Positive<f64>
source§type Output = Negative
type Output = Negative
Copysign::copysign()
.source§impl Copysign<NegativeFinite> for Positive<f64>
impl Copysign<NegativeFinite> for Positive<f64>
source§type Output = Negative
type Output = Negative
Copysign::copysign()
.source§impl Copysign<NonNaN> for Positive<f64>
impl Copysign<NonNaN> for Positive<f64>
source§type Output = NonNaN
type Output = NonNaN
Copysign::copysign()
.source§impl Copysign<NonNaNFinite> for Positive<f64>
impl Copysign<NonNaNFinite> for Positive<f64>
source§type Output = NonNaN
type Output = NonNaN
Copysign::copysign()
.source§impl Copysign<NonZeroNonNaN> for Positive<f64>
impl Copysign<NonZeroNonNaN> for Positive<f64>
source§type Output = NonNaN
type Output = NonNaN
Copysign::copysign()
.source§impl Copysign<NonZeroNonNaNFinite> for Positive<f64>
impl Copysign<NonZeroNonNaNFinite> for Positive<f64>
source§type Output = NonNaN
type Output = NonNaN
Copysign::copysign()
.source§impl Copysign<Positive<f32>> for NegativeFinite<f32>
impl Copysign<Positive<f32>> for NegativeFinite<f32>
source§type Output = PositiveFinite<f32>
type Output = PositiveFinite<f32>
Copysign::copysign()
.source§impl Copysign<Positive<f32>> for NonNaNFinite<f32>
impl Copysign<Positive<f32>> for NonNaNFinite<f32>
source§type Output = PositiveFinite<f32>
type Output = PositiveFinite<f32>
Copysign::copysign()
.source§impl Copysign<Positive<f32>> for NonZeroNonNaN<f32>
impl Copysign<Positive<f32>> for NonZeroNonNaN<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Copysign::copysign()
.source§impl Copysign<Positive<f32>> for NonZeroNonNaNFinite<f32>
impl Copysign<Positive<f32>> for NonZeroNonNaNFinite<f32>
source§type Output = StrictlyPositiveFinite<f32>
type Output = StrictlyPositiveFinite<f32>
Copysign::copysign()
.source§impl Copysign<Positive<f32>> for PositiveFinite<f32>
impl Copysign<Positive<f32>> for PositiveFinite<f32>
source§type Output = PositiveFinite<f32>
type Output = PositiveFinite<f32>
Copysign::copysign()
.source§impl Copysign<Positive<f32>> for StrictlyNegative<f32>
impl Copysign<Positive<f32>> for StrictlyNegative<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Copysign::copysign()
.source§impl Copysign<Positive<f32>> for StrictlyNegativeFinite<f32>
impl Copysign<Positive<f32>> for StrictlyNegativeFinite<f32>
source§type Output = StrictlyPositiveFinite<f32>
type Output = StrictlyPositiveFinite<f32>
Copysign::copysign()
.source§impl Copysign<Positive<f32>> for StrictlyPositive<f32>
impl Copysign<Positive<f32>> for StrictlyPositive<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Copysign::copysign()
.source§impl Copysign<Positive<f32>> for StrictlyPositiveFinite<f32>
impl Copysign<Positive<f32>> for StrictlyPositiveFinite<f32>
source§type Output = StrictlyPositiveFinite<f32>
type Output = StrictlyPositiveFinite<f32>
Copysign::copysign()
.source§impl Copysign<Positive> for Negative<f64>
impl Copysign<Positive> for Negative<f64>
source§type Output = Positive
type Output = Positive
Copysign::copysign()
.source§impl Copysign<Positive> for NegativeFinite<f64>
impl Copysign<Positive> for NegativeFinite<f64>
source§type Output = PositiveFinite
type Output = PositiveFinite
Copysign::copysign()
.source§impl Copysign<Positive> for NonNaN<f64>
impl Copysign<Positive> for NonNaN<f64>
source§type Output = Positive
type Output = Positive
Copysign::copysign()
.source§impl Copysign<Positive> for NonNaNFinite<f64>
impl Copysign<Positive> for NonNaNFinite<f64>
source§type Output = PositiveFinite
type Output = PositiveFinite
Copysign::copysign()
.source§impl Copysign<Positive> for NonZeroNonNaN<f64>
impl Copysign<Positive> for NonZeroNonNaN<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Copysign::copysign()
.source§impl Copysign<Positive> for NonZeroNonNaNFinite<f64>
impl Copysign<Positive> for NonZeroNonNaNFinite<f64>
source§type Output = StrictlyPositiveFinite
type Output = StrictlyPositiveFinite
Copysign::copysign()
.source§impl Copysign<Positive> for Positive<f64>
impl Copysign<Positive> for Positive<f64>
source§type Output = Positive
type Output = Positive
Copysign::copysign()
.source§impl Copysign<Positive> for PositiveFinite<f64>
impl Copysign<Positive> for PositiveFinite<f64>
source§type Output = PositiveFinite
type Output = PositiveFinite
Copysign::copysign()
.source§impl Copysign<Positive> for StrictlyNegative<f64>
impl Copysign<Positive> for StrictlyNegative<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Copysign::copysign()
.source§impl Copysign<Positive> for StrictlyNegativeFinite<f64>
impl Copysign<Positive> for StrictlyNegativeFinite<f64>
source§type Output = StrictlyPositiveFinite
type Output = StrictlyPositiveFinite
Copysign::copysign()
.source§impl Copysign<Positive> for StrictlyPositive<f64>
impl Copysign<Positive> for StrictlyPositive<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Copysign::copysign()
.source§impl Copysign<Positive> for StrictlyPositiveFinite<f64>
impl Copysign<Positive> for StrictlyPositiveFinite<f64>
source§type Output = StrictlyPositiveFinite
type Output = StrictlyPositiveFinite
Copysign::copysign()
.source§impl Copysign<PositiveFinite> for Positive<f64>
impl Copysign<PositiveFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Copysign::copysign()
.source§impl Copysign<StrictlyNegative> for Positive<f64>
impl Copysign<StrictlyNegative> for Positive<f64>
source§type Output = Negative
type Output = Negative
Copysign::copysign()
.source§impl Copysign<StrictlyNegativeFinite> for Positive<f64>
impl Copysign<StrictlyNegativeFinite> for Positive<f64>
source§type Output = Negative
type Output = Negative
Copysign::copysign()
.source§impl Copysign<StrictlyPositive> for Positive<f64>
impl Copysign<StrictlyPositive> for Positive<f64>
source§type Output = Positive
type Output = Positive
Copysign::copysign()
.source§impl Copysign<StrictlyPositiveFinite> for Positive<f64>
impl Copysign<StrictlyPositiveFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Copysign::copysign()
.source§impl<'de> Deserialize<'de> for Positive<f64>
impl<'de> Deserialize<'de> for Positive<f64>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl<'de> Deserialize<'de> for Positive<f32>
impl<'de> Deserialize<'de> for Positive<f32>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl DivAssign<StrictlyPositiveFinite<f32>> for Positive<f32>
impl DivAssign<StrictlyPositiveFinite<f32>> for Positive<f32>
source§fn div_assign(&mut self, rhs: StrictlyPositiveFinite<f32>)
fn div_assign(&mut self, rhs: StrictlyPositiveFinite<f32>)
/=
operation. Read moresource§impl DivAssign<StrictlyPositiveFinite> for Positive<f64>
impl DivAssign<StrictlyPositiveFinite> for Positive<f64>
source§fn div_assign(&mut self, rhs: StrictlyPositiveFinite<f64>)
fn div_assign(&mut self, rhs: StrictlyPositiveFinite<f64>)
/=
operation. Read moresource§impl DivEuclid<Negative<f32>> for Positive<f32>
impl DivEuclid<Negative<f32>> for Positive<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<Negative> for Positive<f64>
impl DivEuclid<Negative> for Positive<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<NegativeFinite<f32>> for Positive<f32>
impl DivEuclid<NegativeFinite<f32>> for Positive<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: NegativeFinite<f32>) -> Self::Output
fn div_euclid(self, rhs: NegativeFinite<f32>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<NegativeFinite> for Positive<f64>
impl DivEuclid<NegativeFinite> for Positive<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: NegativeFinite<f64>) -> Self::Output
fn div_euclid(self, rhs: NegativeFinite<f64>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<NonNaN<f32>> for Positive<f32>
impl DivEuclid<NonNaN<f32>> for Positive<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<NonNaN> for Positive<f64>
impl DivEuclid<NonNaN> for Positive<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<NonNaNFinite<f32>> for Positive<f32>
impl DivEuclid<NonNaNFinite<f32>> for Positive<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: NonNaNFinite<f32>) -> Self::Output
fn div_euclid(self, rhs: NonNaNFinite<f32>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<NonNaNFinite> for Positive<f64>
impl DivEuclid<NonNaNFinite> for Positive<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: NonNaNFinite<f64>) -> Self::Output
fn div_euclid(self, rhs: NonNaNFinite<f64>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<NonZeroNonNaN<f32>> for Positive<f32>
impl DivEuclid<NonZeroNonNaN<f32>> for Positive<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: NonZeroNonNaN<f32>) -> Self::Output
fn div_euclid(self, rhs: NonZeroNonNaN<f32>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<NonZeroNonNaN> for Positive<f64>
impl DivEuclid<NonZeroNonNaN> for Positive<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: NonZeroNonNaN<f64>) -> Self::Output
fn div_euclid(self, rhs: NonZeroNonNaN<f64>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<NonZeroNonNaNFinite<f32>> for Positive<f32>
impl DivEuclid<NonZeroNonNaNFinite<f32>> for Positive<f32>
source§fn div_euclid(self, rhs: NonZeroNonNaNFinite<f32>) -> Self::Output
fn div_euclid(self, rhs: NonZeroNonNaNFinite<f32>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<NonZeroNonNaNFinite> for Positive<f64>
impl DivEuclid<NonZeroNonNaNFinite> for Positive<f64>
source§type Output = NonNaN
type Output = NonNaN
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: NonZeroNonNaNFinite<f64>) -> Self::Output
fn div_euclid(self, rhs: NonZeroNonNaNFinite<f64>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<Positive<f32>> for Negative<f32>
impl DivEuclid<Positive<f32>> for Negative<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive<f32>> for NegativeFinite<f32>
impl DivEuclid<Positive<f32>> for NegativeFinite<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive<f32>> for NonNaN<f32>
impl DivEuclid<Positive<f32>> for NonNaN<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive<f32>> for NonNaNFinite<f32>
impl DivEuclid<Positive<f32>> for NonNaNFinite<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive<f32>> for NonZeroNonNaN<f32>
impl DivEuclid<Positive<f32>> for NonZeroNonNaN<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive<f32>> for Positive<f32>
impl DivEuclid<Positive<f32>> for Positive<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive<f32>> for PositiveFinite<f32>
impl DivEuclid<Positive<f32>> for PositiveFinite<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive<f32>> for StrictlyNegative<f32>
impl DivEuclid<Positive<f32>> for StrictlyNegative<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive<f32>> for StrictlyPositive<f32>
impl DivEuclid<Positive<f32>> for StrictlyPositive<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for Negative<f64>
impl DivEuclid<Positive> for Negative<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for NegativeFinite<f64>
impl DivEuclid<Positive> for NegativeFinite<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for NonNaN<f64>
impl DivEuclid<Positive> for NonNaN<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for NonNaNFinite<f64>
impl DivEuclid<Positive> for NonNaNFinite<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for NonZeroNonNaN<f64>
impl DivEuclid<Positive> for NonZeroNonNaN<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for NonZeroNonNaNFinite<f64>
impl DivEuclid<Positive> for NonZeroNonNaNFinite<f64>
source§type Output = NonNaN
type Output = NonNaN
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for Positive<f64>
impl DivEuclid<Positive> for Positive<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for PositiveFinite<f64>
impl DivEuclid<Positive> for PositiveFinite<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for StrictlyNegative<f64>
impl DivEuclid<Positive> for StrictlyNegative<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for StrictlyNegativeFinite<f64>
impl DivEuclid<Positive> for StrictlyNegativeFinite<f64>
source§type Output = Negative
type Output = Negative
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for StrictlyPositive<f64>
impl DivEuclid<Positive> for StrictlyPositive<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§impl DivEuclid<Positive> for StrictlyPositiveFinite<f64>
impl DivEuclid<Positive> for StrictlyPositiveFinite<f64>
source§type Output = Positive
type Output = Positive
DivEuclid::div_euclid()
.source§impl DivEuclid<PositiveFinite<f32>> for Positive<f32>
impl DivEuclid<PositiveFinite<f32>> for Positive<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: PositiveFinite<f32>) -> Self::Output
fn div_euclid(self, rhs: PositiveFinite<f32>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<PositiveFinite> for Positive<f64>
impl DivEuclid<PositiveFinite> for Positive<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: PositiveFinite<f64>) -> Self::Output
fn div_euclid(self, rhs: PositiveFinite<f64>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<StrictlyNegative<f32>> for Positive<f32>
impl DivEuclid<StrictlyNegative<f32>> for Positive<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: StrictlyNegative<f32>) -> Self::Output
fn div_euclid(self, rhs: StrictlyNegative<f32>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<StrictlyNegative> for Positive<f64>
impl DivEuclid<StrictlyNegative> for Positive<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: StrictlyNegative<f64>) -> Self::Output
fn div_euclid(self, rhs: StrictlyNegative<f64>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<StrictlyNegativeFinite<f32>> for Positive<f32>
impl DivEuclid<StrictlyNegativeFinite<f32>> for Positive<f32>
source§fn div_euclid(self, rhs: StrictlyNegativeFinite<f32>) -> Self::Output
fn div_euclid(self, rhs: StrictlyNegativeFinite<f32>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<StrictlyNegativeFinite> for Positive<f64>
impl DivEuclid<StrictlyNegativeFinite> for Positive<f64>
source§type Output = Negative
type Output = Negative
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: StrictlyNegativeFinite<f64>) -> Self::Output
fn div_euclid(self, rhs: StrictlyNegativeFinite<f64>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<StrictlyPositive<f32>> for Positive<f32>
impl DivEuclid<StrictlyPositive<f32>> for Positive<f32>
source§type Output = f32
type Output = f32
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: StrictlyPositive<f32>) -> Self::Output
fn div_euclid(self, rhs: StrictlyPositive<f32>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<StrictlyPositive> for Positive<f64>
impl DivEuclid<StrictlyPositive> for Positive<f64>
source§type Output = f64
type Output = f64
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: StrictlyPositive<f64>) -> Self::Output
fn div_euclid(self, rhs: StrictlyPositive<f64>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<StrictlyPositiveFinite<f32>> for Positive<f32>
impl DivEuclid<StrictlyPositiveFinite<f32>> for Positive<f32>
source§fn div_euclid(self, rhs: StrictlyPositiveFinite<f32>) -> Self::Output
fn div_euclid(self, rhs: StrictlyPositiveFinite<f32>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl DivEuclid<StrictlyPositiveFinite> for Positive<f64>
impl DivEuclid<StrictlyPositiveFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
DivEuclid::div_euclid()
.source§fn div_euclid(self, rhs: StrictlyPositiveFinite<f64>) -> Self::Output
fn div_euclid(self, rhs: StrictlyPositiveFinite<f64>) -> Self::Output
rem_euclid
.
Equal to self if the sign of self and sign are the same, otherwise equal to -self. Read moresource§impl From<NonZero<u16>> for Positive<f64>
impl From<NonZero<u16>> for Positive<f64>
source§fn from(value: NonZeroU16) -> Self
fn from(value: NonZeroU16) -> Self
source§impl From<NonZero<u16>> for Positive<f32>
impl From<NonZero<u16>> for Positive<f32>
source§fn from(value: NonZeroU16) -> Self
fn from(value: NonZeroU16) -> Self
source§impl From<NonZero<u32>> for Positive<f64>
impl From<NonZero<u32>> for Positive<f64>
source§fn from(value: NonZeroU32) -> Self
fn from(value: NonZeroU32) -> Self
source§impl From<NonZero<u32>> for Positive<f32>
impl From<NonZero<u32>> for Positive<f32>
source§fn from(value: NonZeroU32) -> Self
fn from(value: NonZeroU32) -> Self
source§impl From<NonZero<u64>> for Positive<f64>
impl From<NonZero<u64>> for Positive<f64>
source§fn from(value: NonZeroU64) -> Self
fn from(value: NonZeroU64) -> Self
source§impl From<NonZero<u64>> for Positive<f32>
impl From<NonZero<u64>> for Positive<f32>
source§fn from(value: NonZeroU64) -> Self
fn from(value: NonZeroU64) -> Self
source§impl From<PositiveFinite<f32>> for Positive<f32>
impl From<PositiveFinite<f32>> for Positive<f32>
source§fn from(value: PositiveFinite<f32>) -> Self
fn from(value: PositiveFinite<f32>) -> Self
source§impl From<PositiveFinite> for Positive<f64>
impl From<PositiveFinite> for Positive<f64>
source§fn from(value: PositiveFinite<f64>) -> Self
fn from(value: PositiveFinite<f64>) -> Self
source§impl From<StrictlyPositive<f32>> for Positive<f32>
impl From<StrictlyPositive<f32>> for Positive<f32>
source§fn from(value: StrictlyPositive<f32>) -> Self
fn from(value: StrictlyPositive<f32>) -> Self
source§impl From<StrictlyPositive> for Positive<f64>
impl From<StrictlyPositive> for Positive<f64>
source§fn from(value: StrictlyPositive<f64>) -> Self
fn from(value: StrictlyPositive<f64>) -> Self
source§impl From<StrictlyPositiveFinite<f32>> for Positive<f32>
impl From<StrictlyPositiveFinite<f32>> for Positive<f32>
source§fn from(value: StrictlyPositiveFinite<f32>) -> Self
fn from(value: StrictlyPositiveFinite<f32>) -> Self
source§impl From<StrictlyPositiveFinite> for Positive<f64>
impl From<StrictlyPositiveFinite> for Positive<f64>
source§fn from(value: StrictlyPositiveFinite<f64>) -> Self
fn from(value: StrictlyPositiveFinite<f64>) -> Self
source§impl Hypot<Negative> for Positive<f64>
impl Hypot<Negative> for Positive<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<NegativeFinite> for Positive<f64>
impl Hypot<NegativeFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<NonNaN> for Positive<f64>
impl Hypot<NonNaN> for Positive<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<NonNaNFinite> for Positive<f64>
impl Hypot<NonNaNFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<NonZeroNonNaN<f32>> for Positive<f32>
impl Hypot<NonZeroNonNaN<f32>> for Positive<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<NonZeroNonNaN> for Positive<f64>
impl Hypot<NonZeroNonNaN> for Positive<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<NonZeroNonNaNFinite<f32>> for Positive<f32>
impl Hypot<NonZeroNonNaNFinite<f32>> for Positive<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<NonZeroNonNaNFinite> for Positive<f64>
impl Hypot<NonZeroNonNaNFinite> for Positive<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<Positive<f32>> for NonZeroNonNaN<f32>
impl Hypot<Positive<f32>> for NonZeroNonNaN<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<Positive<f32>> for NonZeroNonNaNFinite<f32>
impl Hypot<Positive<f32>> for NonZeroNonNaNFinite<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<Positive<f32>> for StrictlyNegative<f32>
impl Hypot<Positive<f32>> for StrictlyNegative<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<Positive<f32>> for StrictlyNegativeFinite<f32>
impl Hypot<Positive<f32>> for StrictlyNegativeFinite<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<Positive<f32>> for StrictlyPositive<f32>
impl Hypot<Positive<f32>> for StrictlyPositive<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<Positive<f32>> for StrictlyPositiveFinite<f32>
impl Hypot<Positive<f32>> for StrictlyPositiveFinite<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<Positive> for Negative<f64>
impl Hypot<Positive> for Negative<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<Positive> for NegativeFinite<f64>
impl Hypot<Positive> for NegativeFinite<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<Positive> for NonNaN<f64>
impl Hypot<Positive> for NonNaN<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<Positive> for NonNaNFinite<f64>
impl Hypot<Positive> for NonNaNFinite<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<Positive> for NonZeroNonNaN<f64>
impl Hypot<Positive> for NonZeroNonNaN<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<Positive> for NonZeroNonNaNFinite<f64>
impl Hypot<Positive> for NonZeroNonNaNFinite<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<Positive> for Positive<f64>
impl Hypot<Positive> for Positive<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<Positive> for PositiveFinite<f64>
impl Hypot<Positive> for PositiveFinite<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<Positive> for StrictlyNegative<f64>
impl Hypot<Positive> for StrictlyNegative<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<Positive> for StrictlyNegativeFinite<f64>
impl Hypot<Positive> for StrictlyNegativeFinite<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<Positive> for StrictlyPositive<f64>
impl Hypot<Positive> for StrictlyPositive<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<Positive> for StrictlyPositiveFinite<f64>
impl Hypot<Positive> for StrictlyPositiveFinite<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<PositiveFinite> for Positive<f64>
impl Hypot<PositiveFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Hypot::hypot()
.source§impl Hypot<StrictlyNegative<f32>> for Positive<f32>
impl Hypot<StrictlyNegative<f32>> for Positive<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<StrictlyNegative> for Positive<f64>
impl Hypot<StrictlyNegative> for Positive<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<StrictlyNegativeFinite<f32>> for Positive<f32>
impl Hypot<StrictlyNegativeFinite<f32>> for Positive<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<StrictlyNegativeFinite> for Positive<f64>
impl Hypot<StrictlyNegativeFinite> for Positive<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<StrictlyPositive<f32>> for Positive<f32>
impl Hypot<StrictlyPositive<f32>> for Positive<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<StrictlyPositive> for Positive<f64>
impl Hypot<StrictlyPositive> for Positive<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Hypot<StrictlyPositiveFinite<f32>> for Positive<f32>
impl Hypot<StrictlyPositiveFinite<f32>> for Positive<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Hypot::hypot()
.source§impl Hypot<StrictlyPositiveFinite> for Positive<f64>
impl Hypot<StrictlyPositiveFinite> for Positive<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Hypot::hypot()
.source§impl Max<StrictlyPositive<f32>> for Positive<f32>
impl Max<StrictlyPositive<f32>> for Positive<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Max::max()
.source§impl Max<StrictlyPositive> for Positive<f64>
impl Max<StrictlyPositive> for Positive<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Max::max()
.source§impl Max<StrictlyPositiveFinite<f32>> for Positive<f32>
impl Max<StrictlyPositiveFinite<f32>> for Positive<f32>
source§type Output = StrictlyPositive<f32>
type Output = StrictlyPositive<f32>
Max::max()
.source§impl Max<StrictlyPositiveFinite> for Positive<f64>
impl Max<StrictlyPositiveFinite> for Positive<f64>
source§type Output = StrictlyPositive
type Output = StrictlyPositive
Max::max()
.source§impl Min<NegativeFinite<f32>> for Positive<f32>
impl Min<NegativeFinite<f32>> for Positive<f32>
source§type Output = NonNaNFinite<f32>
type Output = NonNaNFinite<f32>
Min::min()
.source§impl Min<NegativeFinite> for Positive<f64>
impl Min<NegativeFinite> for Positive<f64>
source§type Output = NonNaNFinite
type Output = NonNaNFinite
Min::min()
.source§impl Min<NonNaNFinite<f32>> for Positive<f32>
impl Min<NonNaNFinite<f32>> for Positive<f32>
source§type Output = NonNaNFinite<f32>
type Output = NonNaNFinite<f32>
Min::min()
.source§impl Min<NonNaNFinite> for Positive<f64>
impl Min<NonNaNFinite> for Positive<f64>
source§type Output = NonNaNFinite
type Output = NonNaNFinite
Min::min()
.source§impl Min<NonZeroNonNaNFinite<f32>> for Positive<f32>
impl Min<NonZeroNonNaNFinite<f32>> for Positive<f32>
source§type Output = NonNaNFinite<f32>
type Output = NonNaNFinite<f32>
Min::min()
.source§impl Min<NonZeroNonNaNFinite> for Positive<f64>
impl Min<NonZeroNonNaNFinite> for Positive<f64>
source§type Output = NonNaNFinite
type Output = NonNaNFinite
Min::min()
.source§impl Min<PositiveFinite<f32>> for Positive<f32>
impl Min<PositiveFinite<f32>> for Positive<f32>
source§type Output = PositiveFinite<f32>
type Output = PositiveFinite<f32>
Min::min()
.source§impl Min<PositiveFinite> for Positive<f64>
impl Min<PositiveFinite> for Positive<f64>
source§type Output = PositiveFinite
type Output = PositiveFinite
Min::min()
.source§impl Min<StrictlyNegative<f32>> for Positive<f32>
impl Min<StrictlyNegative<f32>> for Positive<f32>
source§type Output = StrictlyNegative<f32>
type Output = StrictlyNegative<f32>
Min::min()
.source§impl Min<StrictlyNegative> for Positive<f64>
impl Min<StrictlyNegative> for Positive<f64>
source§type Output = StrictlyNegative
type Output = StrictlyNegative
Min::min()
.source§impl Min<StrictlyNegativeFinite<f32>> for Positive<f32>
impl Min<StrictlyNegativeFinite<f32>> for Positive<f32>
source§type Output = StrictlyNegativeFinite<f32>
type Output = StrictlyNegativeFinite<f32>
Min::min()
.source§impl Min<StrictlyNegativeFinite> for Positive<f64>
impl Min<StrictlyNegativeFinite> for Positive<f64>
source§type Output = StrictlyNegativeFinite
type Output = StrictlyNegativeFinite
Min::min()
.source§impl Min<StrictlyPositiveFinite<f32>> for Positive<f32>
impl Min<StrictlyPositiveFinite<f32>> for Positive<f32>
source§type Output = PositiveFinite<f32>
type Output = PositiveFinite<f32>
Min::min()
.source§impl Min<StrictlyPositiveFinite> for Positive<f64>
impl Min<StrictlyPositiveFinite> for Positive<f64>
source§type Output = PositiveFinite
type Output = PositiveFinite
Min::min()
.source§impl MulAssign<StrictlyPositiveFinite<f32>> for Positive<f32>
impl MulAssign<StrictlyPositiveFinite<f32>> for Positive<f32>
source§fn mul_assign(&mut self, rhs: StrictlyPositiveFinite<f32>)
fn mul_assign(&mut self, rhs: StrictlyPositiveFinite<f32>)
*=
operation. Read moresource§impl MulAssign<StrictlyPositiveFinite> for Positive<f64>
impl MulAssign<StrictlyPositiveFinite> for Positive<f64>
source§fn mul_assign(&mut self, rhs: StrictlyPositiveFinite<f64>)
fn mul_assign(&mut self, rhs: StrictlyPositiveFinite<f64>)
*=
operation. Read moresource§impl Ord for Positive<f64>
impl Ord for Positive<f64>
source§impl Ord for Positive<f32>
impl Ord for Positive<f32>
source§impl PartialOrd<Negative<f32>> for Positive<f32>
impl PartialOrd<Negative<f32>> for Positive<f32>
source§impl PartialOrd<Negative> for Positive<f64>
impl PartialOrd<Negative> for Positive<f64>
source§impl PartialOrd<NegativeFinite<f32>> for Positive<f32>
impl PartialOrd<NegativeFinite<f32>> for Positive<f32>
source§impl PartialOrd<NegativeFinite> for Positive<f64>
impl PartialOrd<NegativeFinite> for Positive<f64>
source§impl PartialOrd<NonNaN<f32>> for Positive<f32>
impl PartialOrd<NonNaN<f32>> for Positive<f32>
source§impl PartialOrd<NonNaN> for Positive<f64>
impl PartialOrd<NonNaN> for Positive<f64>
source§impl PartialOrd<NonNaNFinite<f32>> for Positive<f32>
impl PartialOrd<NonNaNFinite<f32>> for Positive<f32>
source§impl PartialOrd<NonNaNFinite> for Positive<f64>
impl PartialOrd<NonNaNFinite> for Positive<f64>
source§impl PartialOrd<NonZeroNonNaN<f32>> for Positive<f32>
impl PartialOrd<NonZeroNonNaN<f32>> for Positive<f32>
source§impl PartialOrd<NonZeroNonNaN> for Positive<f64>
impl PartialOrd<NonZeroNonNaN> for Positive<f64>
source§impl PartialOrd<NonZeroNonNaNFinite<f32>> for Positive<f32>
impl PartialOrd<NonZeroNonNaNFinite<f32>> for Positive<f32>
source§impl PartialOrd<NonZeroNonNaNFinite> for Positive<f64>
impl PartialOrd<NonZeroNonNaNFinite> for Positive<f64>
source§impl PartialOrd<Positive<f32>> for Negative<f32>
impl PartialOrd<Positive<f32>> for Negative<f32>
source§impl PartialOrd<Positive<f32>> for NegativeFinite<f32>
impl PartialOrd<Positive<f32>> for NegativeFinite<f32>
source§impl PartialOrd<Positive<f32>> for NonNaN<f32>
impl PartialOrd<Positive<f32>> for NonNaN<f32>
source§impl PartialOrd<Positive<f32>> for NonNaNFinite<f32>
impl PartialOrd<Positive<f32>> for NonNaNFinite<f32>
source§impl PartialOrd<Positive<f32>> for NonZeroNonNaN<f32>
impl PartialOrd<Positive<f32>> for NonZeroNonNaN<f32>
source§impl PartialOrd<Positive<f32>> for NonZeroNonNaNFinite<f32>
impl PartialOrd<Positive<f32>> for NonZeroNonNaNFinite<f32>
source§impl PartialOrd<Positive<f32>> for PositiveFinite<f32>
impl PartialOrd<Positive<f32>> for PositiveFinite<f32>
source§impl PartialOrd<Positive<f32>> for StrictlyNegative<f32>
impl PartialOrd<Positive<f32>> for StrictlyNegative<f32>
source§impl PartialOrd<Positive<f32>> for StrictlyNegativeFinite<f32>
impl PartialOrd<Positive<f32>> for StrictlyNegativeFinite<f32>
source§impl PartialOrd<Positive<f32>> for StrictlyPositive<f32>
impl PartialOrd<Positive<f32>> for StrictlyPositive<f32>
source§impl PartialOrd<Positive<f32>> for StrictlyPositiveFinite<f32>
impl PartialOrd<Positive<f32>> for StrictlyPositiveFinite<f32>
source§impl PartialOrd<Positive<f32>> for f32
impl PartialOrd<Positive<f32>> for f32
source§impl PartialOrd<Positive> for Negative<f64>
impl PartialOrd<Positive> for Negative<f64>
source§impl PartialOrd<Positive> for NegativeFinite<f64>
impl PartialOrd<Positive> for NegativeFinite<f64>
source§impl PartialOrd<Positive> for NonNaN<f64>
impl PartialOrd<Positive> for NonNaN<f64>
source§impl PartialOrd<Positive> for NonNaNFinite<f64>
impl PartialOrd<Positive> for NonNaNFinite<f64>
source§impl PartialOrd<Positive> for NonZeroNonNaN<f64>
impl PartialOrd<Positive> for NonZeroNonNaN<f64>
source§impl PartialOrd<Positive> for NonZeroNonNaNFinite<f64>
impl PartialOrd<Positive> for NonZeroNonNaNFinite<f64>
source§impl PartialOrd<Positive> for PositiveFinite<f64>
impl PartialOrd<Positive> for PositiveFinite<f64>
source§impl PartialOrd<Positive> for StrictlyNegative<f64>
impl PartialOrd<Positive> for StrictlyNegative<f64>
source§impl PartialOrd<Positive> for StrictlyNegativeFinite<f64>
impl PartialOrd<Positive> for StrictlyNegativeFinite<f64>
source§impl PartialOrd<Positive> for StrictlyPositive<f64>
impl PartialOrd<Positive> for StrictlyPositive<f64>
source§impl PartialOrd<Positive> for StrictlyPositiveFinite<f64>
impl PartialOrd<Positive> for StrictlyPositiveFinite<f64>
source§impl PartialOrd<Positive> for f64
impl PartialOrd<Positive> for f64
source§impl PartialOrd<PositiveFinite<f32>> for Positive<f32>
impl PartialOrd<PositiveFinite<f32>> for Positive<f32>
source§impl PartialOrd<PositiveFinite> for Positive<f64>
impl PartialOrd<PositiveFinite> for Positive<f64>
source§impl PartialOrd<StrictlyNegative<f32>> for Positive<f32>
impl PartialOrd<StrictlyNegative<f32>> for Positive<f32>
source§impl PartialOrd<StrictlyNegative> for Positive<f64>
impl PartialOrd<StrictlyNegative> for Positive<f64>
source§impl PartialOrd<StrictlyNegativeFinite<f32>> for Positive<f32>
impl PartialOrd<StrictlyNegativeFinite<f32>> for Positive<f32>
source§impl PartialOrd<StrictlyNegativeFinite> for Positive<f64>
impl PartialOrd<StrictlyNegativeFinite> for Positive<f64>
source§impl PartialOrd<StrictlyPositive<f32>> for Positive<f32>
impl PartialOrd<StrictlyPositive<f32>> for Positive<f32>
source§impl PartialOrd<StrictlyPositive> for Positive<f64>
impl PartialOrd<StrictlyPositive> for Positive<f64>
source§impl PartialOrd<StrictlyPositiveFinite<f32>> for Positive<f32>
impl PartialOrd<StrictlyPositiveFinite<f32>> for Positive<f32>
source§impl PartialOrd<StrictlyPositiveFinite> for Positive<f64>
impl PartialOrd<StrictlyPositiveFinite> for Positive<f64>
source§impl PartialOrd<f32> for Positive<f32>
impl PartialOrd<f32> for Positive<f32>
source§impl PartialOrd<f64> for Positive<f64>
impl PartialOrd<f64> for Positive<f64>
source§impl PartialOrd for Positive<f64>
impl PartialOrd for Positive<f64>
source§impl PartialOrd for Positive<f32>
impl PartialOrd for Positive<f32>
source§impl Powf<NegativeFinite<f32>> for Positive<f32>
impl Powf<NegativeFinite<f32>> for Positive<f32>
source§fn powf(self, rhs: NegativeFinite<f32>) -> Self::Output
fn powf(self, rhs: NegativeFinite<f32>) -> Self::Output
f64::powf()
for more details.source§impl Powf<NegativeFinite> for Positive<f64>
impl Powf<NegativeFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Powf::powf()
.source§fn powf(self, rhs: NegativeFinite<f64>) -> Self::Output
fn powf(self, rhs: NegativeFinite<f64>) -> Self::Output
f64::powf()
for more details.source§impl Powf<NonNaNFinite<f32>> for Positive<f32>
impl Powf<NonNaNFinite<f32>> for Positive<f32>
source§fn powf(self, rhs: NonNaNFinite<f32>) -> Self::Output
fn powf(self, rhs: NonNaNFinite<f32>) -> Self::Output
f64::powf()
for more details.source§impl Powf<NonNaNFinite> for Positive<f64>
impl Powf<NonNaNFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Powf::powf()
.source§fn powf(self, rhs: NonNaNFinite<f64>) -> Self::Output
fn powf(self, rhs: NonNaNFinite<f64>) -> Self::Output
f64::powf()
for more details.source§impl Powf<NonZeroNonNaN<f32>> for Positive<f32>
impl Powf<NonZeroNonNaN<f32>> for Positive<f32>
source§fn powf(self, rhs: NonZeroNonNaN<f32>) -> Self::Output
fn powf(self, rhs: NonZeroNonNaN<f32>) -> Self::Output
f64::powf()
for more details.source§impl Powf<NonZeroNonNaN> for Positive<f64>
impl Powf<NonZeroNonNaN> for Positive<f64>
source§type Output = Positive
type Output = Positive
Powf::powf()
.source§fn powf(self, rhs: NonZeroNonNaN<f64>) -> Self::Output
fn powf(self, rhs: NonZeroNonNaN<f64>) -> Self::Output
f64::powf()
for more details.source§impl Powf<NonZeroNonNaNFinite<f32>> for Positive<f32>
impl Powf<NonZeroNonNaNFinite<f32>> for Positive<f32>
source§fn powf(self, rhs: NonZeroNonNaNFinite<f32>) -> Self::Output
fn powf(self, rhs: NonZeroNonNaNFinite<f32>) -> Self::Output
f64::powf()
for more details.source§impl Powf<NonZeroNonNaNFinite> for Positive<f64>
impl Powf<NonZeroNonNaNFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Powf::powf()
.source§fn powf(self, rhs: NonZeroNonNaNFinite<f64>) -> Self::Output
fn powf(self, rhs: NonZeroNonNaNFinite<f64>) -> Self::Output
f64::powf()
for more details.source§impl Powf<PositiveFinite<f32>> for Positive<f32>
impl Powf<PositiveFinite<f32>> for Positive<f32>
source§fn powf(self, rhs: PositiveFinite<f32>) -> Self::Output
fn powf(self, rhs: PositiveFinite<f32>) -> Self::Output
f64::powf()
for more details.source§impl Powf<PositiveFinite> for Positive<f64>
impl Powf<PositiveFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Powf::powf()
.source§fn powf(self, rhs: PositiveFinite<f64>) -> Self::Output
fn powf(self, rhs: PositiveFinite<f64>) -> Self::Output
f64::powf()
for more details.source§impl Powf<StrictlyNegative<f32>> for Positive<f32>
impl Powf<StrictlyNegative<f32>> for Positive<f32>
source§fn powf(self, rhs: StrictlyNegative<f32>) -> Self::Output
fn powf(self, rhs: StrictlyNegative<f32>) -> Self::Output
f64::powf()
for more details.source§impl Powf<StrictlyNegative> for Positive<f64>
impl Powf<StrictlyNegative> for Positive<f64>
source§type Output = Positive
type Output = Positive
Powf::powf()
.source§fn powf(self, rhs: StrictlyNegative<f64>) -> Self::Output
fn powf(self, rhs: StrictlyNegative<f64>) -> Self::Output
f64::powf()
for more details.source§impl Powf<StrictlyNegativeFinite<f32>> for Positive<f32>
impl Powf<StrictlyNegativeFinite<f32>> for Positive<f32>
source§fn powf(self, rhs: StrictlyNegativeFinite<f32>) -> Self::Output
fn powf(self, rhs: StrictlyNegativeFinite<f32>) -> Self::Output
f64::powf()
for more details.source§impl Powf<StrictlyNegativeFinite> for Positive<f64>
impl Powf<StrictlyNegativeFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Powf::powf()
.source§fn powf(self, rhs: StrictlyNegativeFinite<f64>) -> Self::Output
fn powf(self, rhs: StrictlyNegativeFinite<f64>) -> Self::Output
f64::powf()
for more details.source§impl Powf<StrictlyPositive<f32>> for Positive<f32>
impl Powf<StrictlyPositive<f32>> for Positive<f32>
source§fn powf(self, rhs: StrictlyPositive<f32>) -> Self::Output
fn powf(self, rhs: StrictlyPositive<f32>) -> Self::Output
f64::powf()
for more details.source§impl Powf<StrictlyPositive> for Positive<f64>
impl Powf<StrictlyPositive> for Positive<f64>
source§type Output = Positive
type Output = Positive
Powf::powf()
.source§fn powf(self, rhs: StrictlyPositive<f64>) -> Self::Output
fn powf(self, rhs: StrictlyPositive<f64>) -> Self::Output
f64::powf()
for more details.source§impl Powf<StrictlyPositiveFinite<f32>> for Positive<f32>
impl Powf<StrictlyPositiveFinite<f32>> for Positive<f32>
source§fn powf(self, rhs: StrictlyPositiveFinite<f32>) -> Self::Output
fn powf(self, rhs: StrictlyPositiveFinite<f32>) -> Self::Output
f64::powf()
for more details.source§impl Powf<StrictlyPositiveFinite> for Positive<f64>
impl Powf<StrictlyPositiveFinite> for Positive<f64>
source§type Output = Positive
type Output = Positive
Powf::powf()
.source§fn powf(self, rhs: StrictlyPositiveFinite<f64>) -> Self::Output
fn powf(self, rhs: StrictlyPositiveFinite<f64>) -> Self::Output
f64::powf()
for more details.source§impl SubAssign<NegativeFinite<f32>> for Positive<f32>
impl SubAssign<NegativeFinite<f32>> for Positive<f32>
source§fn sub_assign(&mut self, rhs: NegativeFinite<f32>)
fn sub_assign(&mut self, rhs: NegativeFinite<f32>)
-=
operation. Read moresource§impl SubAssign<NegativeFinite> for Positive<f64>
impl SubAssign<NegativeFinite> for Positive<f64>
source§fn sub_assign(&mut self, rhs: NegativeFinite<f64>)
fn sub_assign(&mut self, rhs: NegativeFinite<f64>)
-=
operation. Read moresource§impl SubAssign<StrictlyNegative<f32>> for Positive<f32>
impl SubAssign<StrictlyNegative<f32>> for Positive<f32>
source§fn sub_assign(&mut self, rhs: StrictlyNegative<f32>)
fn sub_assign(&mut self, rhs: StrictlyNegative<f32>)
-=
operation. Read moresource§impl SubAssign<StrictlyNegative> for Positive<f64>
impl SubAssign<StrictlyNegative> for Positive<f64>
source§fn sub_assign(&mut self, rhs: StrictlyNegative<f64>)
fn sub_assign(&mut self, rhs: StrictlyNegative<f64>)
-=
operation. Read moresource§impl SubAssign<StrictlyNegativeFinite<f32>> for Positive<f32>
impl SubAssign<StrictlyNegativeFinite<f32>> for Positive<f32>
source§fn sub_assign(&mut self, rhs: StrictlyNegativeFinite<f32>)
fn sub_assign(&mut self, rhs: StrictlyNegativeFinite<f32>)
-=
operation. Read moresource§impl SubAssign<StrictlyNegativeFinite> for Positive<f64>
impl SubAssign<StrictlyNegativeFinite> for Positive<f64>
source§fn sub_assign(&mut self, rhs: StrictlyNegativeFinite<f64>)
fn sub_assign(&mut self, rhs: StrictlyNegativeFinite<f64>)
-=
operation. Read moresource§impl TryFrom<NonZero<i16>> for Positive<f64>
impl TryFrom<NonZero<i16>> for Positive<f64>
source§type Error = InvalidNumber
type Error = InvalidNumber
source§impl TryFrom<NonZero<i16>> for Positive<f32>
impl TryFrom<NonZero<i16>> for Positive<f32>
source§type Error = InvalidNumber
type Error = InvalidNumber
source§impl TryFrom<NonZero<i32>> for Positive<f64>
impl TryFrom<NonZero<i32>> for Positive<f64>
source§type Error = InvalidNumber
type Error = InvalidNumber
source§impl TryFrom<NonZero<i32>> for Positive<f32>
impl TryFrom<NonZero<i32>> for Positive<f32>
source§type Error = InvalidNumber
type Error = InvalidNumber
source§impl TryFrom<NonZero<i64>> for Positive<f64>
impl TryFrom<NonZero<i64>> for Positive<f64>
source§type Error = InvalidNumber
type Error = InvalidNumber
source§impl TryFrom<NonZero<i64>> for Positive<f32>
impl TryFrom<NonZero<i64>> for Positive<f32>
source§type Error = InvalidNumber
type Error = InvalidNumber
impl<T: Copy> Copy for Positive<T>
impl Eq for Positive<f64>
impl Eq for Positive<f32>
Auto Trait Implementations§
impl<T> Freeze for Positive<T>where
T: Freeze,
impl<T> RefUnwindSafe for Positive<T>where
T: RefUnwindSafe,
impl<T> Send for Positive<T>where
T: Send,
impl<T> Sync for Positive<T>where
T: Sync,
impl<T> Unpin for Positive<T>where
T: Unpin,
impl<T> UnwindSafe for Positive<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)