lemonmath::helper

Trait GetDecimal

Source
pub trait GetDecimal {
    // Required method
    fn get_decimal(&self) -> u128;
}
Expand description

A trait to losslessly get the decimal part of a float

§Examples

use lemonmath::helper::GetDecimal;
 
let x = 1.12;
 
assert_eq!(x.get_decimal(), 12);

Required Methods§

Source

fn get_decimal(&self) -> u128

Implementations on Foreign Types§

Source§

impl GetDecimal for f32

Source§

impl GetDecimal for f64

Implementors§