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 more