Skip to main content

Module fixed

Module fixed 

Source
Expand description

fixed-point numerical types

Macrosยง

fixed_impl ๐Ÿ”’
fixed_mul_div_assign ๐Ÿ”’
Implements multiplication and division assignment operators for fixed types.
float_conv ๐Ÿ”’
impl float conversion methods.

Structsยง

F2Dot14
16-bit signed fixed point number with 14 bits of fraction.
F4Dot12
16-bit signed fixed point number with 12 bits of fraction.
F6Dot10
16-bit signed fixed point number with 10 bits of fraction.
F26Dot6
32-bit signed fixed point number with 6 bits of fraction.
F48Dot16
64-bit signed fixed point number with 16 bits of fraction.
Fixed
32-bit signed fixed point number with 16 bits of fraction.

Functionsยง

fmt_shortest ๐Ÿ”’
Format a fixed-point value as the shortest decimal that parses back to it.
write_decimal ๐Ÿ”’
Write digits / 10^places as a decimal at the end of buf and return it.