Documentation ¶
Overview ¶
Package fixed provides types to work with fixed-point numbers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Int12_20 ¶
type Int12_20 uint32
Int12_20 is a signed 12.20 fixed-point number.
The integer part ranges from -2048 to 2047, inclusive. The fractional part has 20 bits of precision.
func I12_20 ¶
I12_20 returns the integer value i as an Int12_20.
For example, passing the integer value 2 yields Int12_20(2097152).
func ParseInt12_20 ¶
ParseInt12_20 converts the string s to a signed 12.20 fixed-point number.
type Int16_16 ¶
type Int16_16 uint32
Int16_16 is a signed 16.16 fixed-point number.
The integer part ranges from -32768 to 32767, inclusive. The fractional part has 20 bits of precision.
func I16_16 ¶
I16_16 returns the integer value i as an Int16_16.
For example, passing the integer value 2 yields Int16_16(131072).
func ParseInt16_16 ¶
ParseInt16_16 converts the string s to a signed 16.16 fixed-point number.