Fixed

Fixed-point math type, fractional bits can be specified, but by default is split evenly; eg Fixed!int will be Q16.16

Note: When converting a fixed-precision number to a floating point number, they may not be exact bit-for-bit equal; as such an approximate equals operation is recommended for comparing fixed point math with

Constructors

this
this(Y other)

Constructor

Members

Aliases

Self
alias Self = typeof(this)

Shorthand for this type

ValueT
alias ValueT = T

Shorthand for the backing type

Enums

FRACT_DIV
eponymoustemplate FRACT_DIV(Y)

Division factor for the given precision of float.

Functions

opAssign
typeof(this) opAssign(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
typeof(this) opBinary(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
typeof(this) opBinary(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
Y opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(R other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(R other)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
typeof(this) opOpAssign(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
typeof(this) opOpAssign(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
toHash
size_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

fromData
auto fromData(T data)

Creates a new instance from raw data.

Variables

FRACT_MASK
enum T FRACT_MASK;

Mask of fractional part

INT_MASK
enum T INT_MASK;

Mask of integer part

SHIFT
enum T SHIFT;

How much to shift the data store in-operation.

data
T data;
Undocumented in source.
max
enum Self max;

Max value of the fixed-precision value

min
enum Self min;

Max value of the fixed-precision value

Meta