Skip to main content

encode

Function encode 

Source
pub fn encode(
    sign: bool,
    coefficient: u128,
    exponent: i32,
    width: Width,
) -> u128
Expand description

The bits of sign * coefficient * 10^exponent, which the caller has already brought into range: the coefficient at most Width::max_coefficient and the exponent between Width::min_exponent and Width::max_exponent.

ยงPanics

If either is out of range, which is a caller that skipped the rounding.