fixed

package
v0.0.0-...-3c91b98 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Places is the number of fixed places
	Places = 16
	// FixedOne is the number 1
	FixedOne = 1 << Places
	// FixedHalf is the number .5
	FixedHalf = 1 << (Places - 1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Fixed

type Fixed int32

Fixed is a fixed point number

func FixedFloat32

func FixedFloat32(a float32) Fixed

FixedFromFloat32 creates a fixed point number from a float32

func FixedFloat64

func FixedFloat64(a float64) Fixed

FixedFromFloat64 creates a fixed point number from a float64

func (Fixed) Abs

func (f Fixed) Abs() Fixed

Abs returns the absolute value

func (Fixed) Float32

func (f Fixed) Float32() float32

Float32 converts the fixed number to a float64

func (Fixed) Float64

func (f Fixed) Float64() float64

Float64 converts the fixed number to a float64

func (Fixed) Mul

func (f Fixed) Mul(b Fixed) Fixed

Mul multiplys to fixed point nuimbers

func (Fixed) String

func (f Fixed) String() string

String converts the fixed point number to a string

Jump to

Keyboard shortcuts

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