#[repr(u8)]pub enum FloatToInt {
Error = 0,
Saturate = 1,
}Expand description
The float_to_int policy: what float-to-integer conversion does with
NaN or an out-of-range value.
§Examples
use bytecode_lang::FloatToInt;
assert_eq!(FloatToInt::default(), FloatToInt::Error);Variants§
Error = 0
Raise InvalidConversion (E0004) through the language’s error model.
Saturate = 1
Clamp to the type’s MIN/MAX; NaN becomes 0.
Implementations§
Source§impl FloatToInt
impl FloatToInt
Trait Implementations§
Source§impl Clone for FloatToInt
impl Clone for FloatToInt
impl Copy for FloatToInt
Source§impl Debug for FloatToInt
impl Debug for FloatToInt
Source§impl Default for FloatToInt
impl Default for FloatToInt
Source§impl Display for FloatToInt
impl Display for FloatToInt
impl Eq for FloatToInt
Source§impl Hash for FloatToInt
impl Hash for FloatToInt
Source§impl Ord for FloatToInt
impl Ord for FloatToInt
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for FloatToInt
impl PartialEq for FloatToInt
Source§impl PartialOrd for FloatToInt
impl PartialOrd for FloatToInt
impl StructuralPartialEq for FloatToInt
Auto Trait Implementations§
impl Freeze for FloatToInt
impl RefUnwindSafe for FloatToInt
impl Send for FloatToInt
impl Sync for FloatToInt
impl Unpin for FloatToInt
impl UnsafeUnpin for FloatToInt
impl UnwindSafe for FloatToInt
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