fixed

package
v0.0.0-...-fd97e0e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2016 License: Apache-2.0, BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package fixed implements fixed-point integer types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Int26_6

type Int26_6 int32

Int26_6 is a signed 26.6 fixed-point number.

The integer part ranges from -33554432 to 33554431, inclusive. The fractional part has 6 bits of precision.

For example, the number one-and-a-quarter is Int26_6(1<<6 + 1<<4).

func (Int26_6) String

func (x Int26_6) String() string

String returns a human-readable representation of a 26.6 fixed-point number.

For example, the number one-and-a-quarter becomes "1:16".

type Int52_12

type Int52_12 int64

Int52_12 is a signed 52.12 fixed-point number.

The integer part ranges from -2251799813685248 to 2251799813685247, inclusive. The fractional part has 12 bits of precision.

For example, the number one-and-a-quarter is Int52_12(1<<12 + 1<<10).

func (Int52_12) String

func (x Int52_12) String() string

String returns a human-readable representation of a 52.12 fixed-point number.

For example, the number one-and-a-quarter becomes "1:1024".

type Point26_6

type Point26_6 struct {
	X, Y Int26_6
}

Point26_6 is a 26.6 fixed-point coordinate pair.

type Point52_12

type Point52_12 struct {
	X, Y Int52_12
}

Point52_12 is a 52.12 fixed-point coordinate pair.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL