unmoving  v0.1.0
More convenient fixed-point arithmetic for the Sony PlayStation
Classes | Functions
unmoving Namespace Reference

Classes

class  PSXFixed
 PSXFixed-point arithmetic value type for Sony PlayStation. More...
 

Functions

constexpr PSXFixed operator""_fx (long double literal)
 User-defined literal for PSXFixed objects with fractional parts. More...
 
constexpr PSXFixed operator""_fx (unsigned long long int literal)
 User-defined literal for PSXFixed objects without fractional parts. More...
 

Function Documentation

◆ operator""_fx() [1/2]

constexpr PSXFixed operator""_fx ( long double  literal)
constexpr

User-defined literal for PSXFixed objects with fractional parts.

Usage:

PSXFixed full = 123.45_fx;
PSXFixed fractional = .45_fx;

◆ operator""_fx() [2/2]

constexpr PSXFixed operator""_fx ( unsigned long long int  literal)
constexpr

User-defined literal for PSXFixed objects without fractional parts.

Usage:

PSXFixed integral = 123_fx;
Warning
Use this to initialise PSXFixed objects when the intention is to hold the same value as the integer. Use regular integer literals when the intention is to interpret the integer as a fixed-point value (this is the fixed-point equivalent of initialising a float from raw memory values).