Skip to main content

step_decimals

Function step_decimals 

pub fn step_decimals(x: f64) -> i64
Expand description

Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation.

var n = step_decimals(5)       # n is 0
n = step_decimals(1.0005)      # n is 4
n = step_decimals(0.000000005) # n is 9