Skip to main content

decimal_value

Function decimal_value 

Source
pub open spec fn decimal_value(bytes: Seq<u8>) -> int
Expand description
{
    EndianNat::<Base10>::new(Endian::Big, bytes.map_values(|byte: u8| byte - b'0'))
        .to_nat() as int
}

The mathematical value of an ASCII decimal byte sequence; empty input is zero.