pub fn integral_exponent_for<F>(&self, x: F) -> i32
    where
        F: Into<f64>,
    {
        let x: f64 = x.into();
        if x == 0.0 {
            return 0;
        }
        match self {
            Self::B1000 => (x.abs().log10() / 3f64).floor() as i32 * 3,
            Self::B1024 => (x.abs().log2() / 10f64).floor() as i32 * 3,
        }
    }
/// Using `floor()`, returns the closest integer exponent to represent the
/// provided value `x` in the self `Base`.
///
/// The returned integer exponent is a multiple of 3 in order to match the
/// prefixes' exponents.
///
/// # Example
///
/// ```
/// use si_scale::base::Base;
///
/// let x: f32  = 5.4e4;
/// let actual = Base::B1000.integral_exponent_for(x);
/// assert_eq!(actual, 3);  // 1e3
///
/// let x: f64  = -5.4e-4;
/// let actual = Base::B1000.integral_exponent_for(x);
/// assert_eq!(actual, -6);  // 1e-6
/// ```
///


The returned integer exponent is a multiple of 3 in order to match the
prefixes' exponents.
The returned integer exponent is a multiple of 3 in order to match the prefixes ' exponents .
pub fn integral_exponent_for<F>(&self, x: F) -> i32
    where
        F: Into<f64>,
    {
        let x: f64 = x.into();
        if x == 0.0 {
            return 0;
        }
        match self {
            Self::B1000 => (x.abs().log10() / 3f64).floor() as i32 * 3,
            Self::B1024 => (x.abs().log2() / 10f64).floor() as i32 * 3,
        }
    }
pub fn integral_exponent_for < F > ( & self , x : F ) -> i32 where F : Into < f64 > , { let x : f64 = x . into ( ) ; if x == 0.0 { return 0 ; } match self { Self :: B1000 => ( x . abs ( ) . log10 ( ) / 3f64 ) . floor ( ) as i32 * 3 , Self :: B1024 => ( x . abs ( ) . log2 ( ) / 10f64 ) . floor ( ) as i32 * 3 , } }
Using `floor()`, returns the closest integer exponent to represent the
provided value `x` in the self `Base`.
Using ` floor () ` returns the closest integer exponent to represent the provided value ` x ` in the self ` Base ` .
&self
x
F
example
```
use si_scale::base::Base.




` ` ` use si_scale :: base :: Base .