Enum uom::ConstantOp
source · pub enum ConstantOp {
Add,
Sub,
}
Expand description
Operations performed on the constant portion of the conversion factor. Used to help guide optimizations when floating point underlying storage types are used.
For a value, v: Float
, adding -0.0
is a no-op while adding 0.0
will change the sign if
v
is -0.0
. The opposite is true for subtraction.
ⓘ
v
0.0 + -0.0 = 0.0
-0.0 + 0.0 = 0.0 // v + 0.0 != v
-0.0 + -0.0 = -0.0
0.0 - -0.0 = 0.0
-0.0 - 0.0 = 0.0
-0.0 - -0.0 = 0.0 // v - -0.0 != v
Variants§
Add
Hint that the constant is being added to a value.
Sub
Hint that the constant is being subtracted from a value.
Trait Implementations§
source§impl Clone for ConstantOp
impl Clone for ConstantOp
source§fn clone(&self) -> ConstantOp
fn clone(&self) -> ConstantOp
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ConstantOp
impl Debug for ConstantOp
impl Copy for ConstantOp
Auto Trait Implementations§
impl Freeze for ConstantOp
impl RefUnwindSafe for ConstantOp
impl Send for ConstantOp
impl Sync for ConstantOp
impl Unpin for ConstantOp
impl UnwindSafe for ConstantOp
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
Mutably borrows from an owned value. Read more