/// Create a new constant float.
///
/// Returns an `OutOfRange` error if the value is outside the type's range.
Create a new constant float.
Returns an `OutOfRange` error if the value is outside the type's range.
Create a new constant float . Returns an ` OutOfRange ` error if the value is outside the type ' s range .
pub fn try_new(ty: &'t FloatingType, value: f64) -> Result<FloatingConst<'t>, ConstError> {
        let valid = match ty.range() {
            Some(r) => r.contains(&value),
            None => true,
        };
        if valid {
            Ok(FloatingConst {
                ty: ty,
                value: value,
            })
        } else {
            Err(ConstError::OutOfRange)
        }
    }
pub fn try_new ( ty : & ' t FloatingType , value : f64 ) -> Result < FloatingConst < ' t > , ConstError > { let valid = match ty . range ( ) { Some ( r ) => r . contains ( & value ) , None => true , } ; if valid { Ok ( FloatingConst { ty : ty , value : value , } ) } else { Err ( ConstError :: OutOfRange ) } }
Create a new constant float.
Create a new constant float .
ty
&'t FloatingType
value
f64