llvm-mos-sdk
Public Types | Public Member Functions | List of all members
FixedPoint< IntSize, FracSize, Signed > Class Template Reference

#include <fixed_point.h>

Collaboration diagram for FixedPoint< IntSize, FracSize, Signed >:
Collaboration graph
[legend]

Public Types

using IntType = std::conditional_t< Signed, _BitInt(IntSize), unsigned _BitInt(IntSize)>
 
using FracType = unsigned _BitInt(FracSize)
 
using StorageType = std::conditional_t< Signed, _BitInt(storage_size), unsigned _BitInt(storage_size)>
 

Public Member Functions

template<typename T , std::enable_if_t< std::is_integral_v< T >, bool > = true>
constexpr FixedPoint (T i)
 
constexpr FixedPoint (IntType i, FracType f)
 Constructor for setting both the integral and fractional part. More...
 
constexpr FixedPoint (const FixedPoint &o)
 
constexpr FixedPointoperator= (FixedPoint o)
 
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
__fp_consteval FixedPoint (T f)
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPoint (FixedPoint< OI, OF, S > o)
 
constexpr IntType as_i () const
 Returns just the integral portion. More...
 
constexpr FracType as_f () const
 Returns just the fractional portion. More...
 
constexpr StorageType get () const
 Returns the entire value. More...
 
constexpr void set_i (IntType value)
 Update just the integral portion. More...
 
constexpr void set_f (FracType value)
 Update just the fractional portion. More...
 
constexpr void set (StorageType value)
 Update the entire value. More...
 
template<intmax_t OI, intmax_t OF, bool S = true>
constexpr FixedPoint< OI, OF, S > as ()
 
constexpr bool is_signed () const
 
constexpr intmax_t bitcount () const
 
constexpr intmax_t int_bitcount () const
 
constexpr intmax_t frac_bitcount () const
 
constexpr FixedPoint operator- () const
 
constexpr FixedPoint operator~ () const
 
constexpr FixedPointoperator%= (FixedPoint o)
 
constexpr FixedPoint operator% (FixedPoint o) const
 
constexpr FixedPointoperator&= (FixedPoint o)
 
constexpr FixedPoint operator& (FixedPoint o) const
 
constexpr FixedPointoperator|= (FixedPoint o)
 
constexpr FixedPoint operator| (FixedPoint o) const
 
constexpr FixedPointoperator^= (FixedPoint o)
 
constexpr FixedPoint operator^ (FixedPoint o) const
 
constexpr FixedPointoperator+= (FixedPoint o)
 
constexpr FixedPoint operator+ (FixedPoint o) const
 
constexpr FixedPointoperator-= (FixedPoint o)
 
constexpr FixedPoint operator- (FixedPoint o) const
 
constexpr FixedPointoperator/= (FixedPoint o)
 
constexpr FixedPoint operator/ (FixedPoint o) const
 
constexpr FixedPointoperator*= (FixedPoint o)
 
constexpr FixedPoint operator* (FixedPoint o) const
 
constexpr FixedPointoperator>>= (StorageType v)
 
constexpr FixedPoint operator>> (StorageType v) const
 
constexpr FixedPointoperator<<= (StorageType v)
 
constexpr FixedPoint operator<< (StorageType v) const
 
FixedPointoperator++ ()
 
FixedPoint operator++ (int)
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator+ (FixedPoint< OI, OF, S > o) const
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPointoperator+= (FixedPoint< OI, OF, S > o)
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator- (FixedPoint< OI, OF, S > o) const
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPointoperator-= (FixedPoint< OI, OF, S > o)
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator% (FixedPoint< OI, OF, S > o) const
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPointoperator%= (FixedPoint< OI, OF, S > o)
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator^ (FixedPoint< OI, OF, S > o) const
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPointoperator^= (FixedPoint< OI, OF, S > o)
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator& (FixedPoint< OI, OF, S > o) const
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPointoperator&= (FixedPoint< OI, OF, S > o)
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator| (FixedPoint< OI, OF, S > o) const
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPointoperator|= (FixedPoint< OI, OF, S > o)
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator* (FixedPoint< OI, OF, S > o) const
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPointoperator*= (FixedPoint< OI, OF, S > o)
 
constexpr bool operator== (const FixedPoint &o) const noexcept
 
constexpr bool operator< (const FixedPoint &o) const noexcept
 
constexpr bool operator!= (const FixedPoint &o) const noexcept
 
constexpr bool operator> (const FixedPoint &o) const noexcept
 
constexpr bool operator>= (const FixedPoint &o) const noexcept
 
constexpr bool operator<= (const FixedPoint &o) const noexcept
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator== (FixedPoint< OI, OF, S > o) const noexcept
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator< (FixedPoint< OI, OF, S > o) const noexcept
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator!= (FixedPoint< OI, OF, S > o) const noexcept
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator> (FixedPoint< OI, OF, S > o) const noexcept
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator>= (FixedPoint< OI, OF, S > o) const noexcept
 
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto operator<= (FixedPoint< OI, OF, S > o) const noexcept
 

Detailed Description

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
class FixedPoint< IntSize, FracSize, Signed >

Numeric Wrapper for Fixed Point math

Without dedicated floating point hardware, fixed point math is a good choice for many llvm-mos targets. This class wraps common fixed point idioms to provide a typesafe way to perform math operations that represent fractional values.

For a quick primer on fixed point math, consider a simple case of a 8.8 fixed point number. The first number represents the number of bits used to hold the Integer portion of the value, and the second 8 bits hold the fractional portion. This has some very useful properties for the 6502 such as when adding two fixed point numbers with the same size, the math is the simply 16 bit math. Another benefit is should you only want to use the integer portion of the value, accessing this comes with no additional cost because its merely the high bytes. This property is not true for all combination of sizes, but in general, it still is reasonably quick to access the higher byte by shifting as needed.

In a little bit more detail, a fixed point number can be considered a regular 16 bit number that is implicitly divided by the size of the fractional portion. With our 8.8 example, the Fractional portion can represent 256 values total, meaning the value in the fractional part represents a number divided by 256. As a practical example, a 16 bit number 0x5060 , and when divided by 0x100 yields 0x50 with a remainder of 0x60. This class makes that divider a part of the type of the class, allowing seamless math operations as if its a normal integer, but with the correct shifting when combining with other values.

Member Typedef Documentation

◆ FracType

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
using FixedPoint< IntSize, FracSize, Signed >::FracType = unsigned _BitInt(FracSize)

◆ IntType

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
using FixedPoint< IntSize, FracSize, Signed >::IntType = std::conditional_t<Signed, _BitInt(IntSize), unsigned _BitInt(IntSize)>

◆ StorageType

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
using FixedPoint< IntSize, FracSize, Signed >::StorageType = std::conditional_t<Signed, _BitInt(storage_size), unsigned _BitInt(storage_size)>

Constructor & Destructor Documentation

◆ FixedPoint() [1/5]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<typename T , std::enable_if_t< std::is_integral_v< T >, bool > = true>
constexpr FixedPoint< IntSize, FracSize, Signed >::FixedPoint ( i)
inlineconstexpr

◆ FixedPoint() [2/5]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint< IntSize, FracSize, Signed >::FixedPoint ( IntType  i,
FracType  f 
)
inlineconstexpr

Constructor for setting both the integral and fractional part.

◆ FixedPoint() [3/5]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint< IntSize, FracSize, Signed >::FixedPoint ( const FixedPoint< IntSize, FracSize, Signed > &  o)
inlineconstexpr

◆ FixedPoint() [4/5]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, bool > = true>
__fp_consteval FixedPoint< IntSize, FracSize, Signed >::FixedPoint ( f)
inlineexplicit

Constructor to convert floating point values into fixed point Multiplying by a power of two only increases the exponent of the floating point number, which is exact so long as overflow does not occur. Rounding a floating point number to whole is always exact.

◆ FixedPoint() [5/5]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPoint< IntSize, FracSize, Signed >::FixedPoint ( FixedPoint< OI, OF, S >  o)
inlineconstexpr

Member Function Documentation

◆ as()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S = true>
constexpr FixedPoint<OI, OF, S> FixedPoint< IntSize, FracSize, Signed >::as ( )
inlineconstexpr

Convert the fixed point value to a new fixed point value with a different size. This is just a convenience function to explicitly convert to a new fixed point type.

◆ as_f()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FracType FixedPoint< IntSize, FracSize, Signed >::as_f ( ) const
inlineconstexpr

Returns just the fractional portion.

◆ as_i()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr IntType FixedPoint< IntSize, FracSize, Signed >::as_i ( ) const
inlineconstexpr

Returns just the integral portion.

◆ bitcount()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr intmax_t FixedPoint< IntSize, FracSize, Signed >::bitcount ( ) const
inlineconstexpr

◆ frac_bitcount()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr intmax_t FixedPoint< IntSize, FracSize, Signed >::frac_bitcount ( ) const
inlineconstexpr

◆ get()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr StorageType FixedPoint< IntSize, FracSize, Signed >::get ( ) const
inlineconstexpr

Returns the entire value.

◆ int_bitcount()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr intmax_t FixedPoint< IntSize, FracSize, Signed >::int_bitcount ( ) const
inlineconstexpr

◆ is_signed()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr bool FixedPoint< IntSize, FracSize, Signed >::is_signed ( ) const
inlineconstexpr

◆ operator!=() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr bool FixedPoint< IntSize, FracSize, Signed >::operator!= ( const FixedPoint< IntSize, FracSize, Signed > &  o) const
inlineconstexprnoexcept

◆ operator!=() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator!= ( FixedPoint< OI, OF, S >  o) const
inlineconstexprnoexcept

◆ operator%() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator% ( FixedPoint< IntSize, FracSize, Signed >  o) const
inlineconstexpr

◆ operator%() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator% ( FixedPoint< OI, OF, S >  o) const
inlineconstexpr

◆ operator%=() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator%= ( FixedPoint< IntSize, FracSize, Signed >  o)
inlineconstexpr

◆ operator%=() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator%= ( FixedPoint< OI, OF, S >  o)
inlineconstexpr

◆ operator&() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator& ( FixedPoint< IntSize, FracSize, Signed >  o) const
inlineconstexpr

◆ operator&() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator& ( FixedPoint< OI, OF, S >  o) const
inlineconstexpr

◆ operator&=() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator&= ( FixedPoint< IntSize, FracSize, Signed >  o)
inlineconstexpr

◆ operator&=() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator&= ( FixedPoint< OI, OF, S >  o)
inlineconstexpr

◆ operator*() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator* ( FixedPoint< IntSize, FracSize, Signed >  o) const
inlineconstexpr

◆ operator*() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator* ( FixedPoint< OI, OF, S >  o) const
inlineconstexpr

◆ operator*=() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator*= ( FixedPoint< IntSize, FracSize, Signed >  o)
inlineconstexpr

◆ operator*=() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator*= ( FixedPoint< OI, OF, S >  o)
inlineconstexpr

◆ operator+() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator+ ( FixedPoint< IntSize, FracSize, Signed >  o) const
inlineconstexpr

◆ operator+() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator+ ( FixedPoint< OI, OF, S >  o) const
inlineconstexpr

◆ operator++() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator++ ( )
inline

◆ operator++() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator++ ( int  )
inline

◆ operator+=() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator+= ( FixedPoint< IntSize, FracSize, Signed >  o)
inlineconstexpr

◆ operator+=() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator+= ( FixedPoint< OI, OF, S >  o)
inlineconstexpr

◆ operator-() [1/3]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator- ( ) const
inlineconstexpr

◆ operator-() [2/3]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator- ( FixedPoint< IntSize, FracSize, Signed >  o) const
inlineconstexpr

◆ operator-() [3/3]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator- ( FixedPoint< OI, OF, S >  o) const
inlineconstexpr

◆ operator-=() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator-= ( FixedPoint< IntSize, FracSize, Signed >  o)
inlineconstexpr

◆ operator-=() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator-= ( FixedPoint< OI, OF, S >  o)
inlineconstexpr

◆ operator/()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator/ ( FixedPoint< IntSize, FracSize, Signed >  o) const
inlineconstexpr

◆ operator/=()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator/= ( FixedPoint< IntSize, FracSize, Signed >  o)
inlineconstexpr

◆ operator<() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr bool FixedPoint< IntSize, FracSize, Signed >::operator< ( const FixedPoint< IntSize, FracSize, Signed > &  o) const
inlineconstexprnoexcept

◆ operator<() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator< ( FixedPoint< OI, OF, S >  o) const
inlineconstexprnoexcept

◆ operator<<()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator<< ( StorageType  v) const
inlineconstexpr

◆ operator<<=()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator<<= ( StorageType  v)
inlineconstexpr

◆ operator<=() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr bool FixedPoint< IntSize, FracSize, Signed >::operator<= ( const FixedPoint< IntSize, FracSize, Signed > &  o) const
inlineconstexprnoexcept

◆ operator<=() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator<= ( FixedPoint< OI, OF, S >  o) const
inlineconstexprnoexcept

◆ operator=()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator= ( FixedPoint< IntSize, FracSize, Signed >  o)
inlineconstexpr

◆ operator==() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr bool FixedPoint< IntSize, FracSize, Signed >::operator== ( const FixedPoint< IntSize, FracSize, Signed > &  o) const
inlineconstexprnoexcept

◆ operator==() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator== ( FixedPoint< OI, OF, S >  o) const
inlineconstexprnoexcept

◆ operator>() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr bool FixedPoint< IntSize, FracSize, Signed >::operator> ( const FixedPoint< IntSize, FracSize, Signed > &  o) const
inlineconstexprnoexcept

◆ operator>() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator> ( FixedPoint< OI, OF, S >  o) const
inlineconstexprnoexcept

◆ operator>=() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr bool FixedPoint< IntSize, FracSize, Signed >::operator>= ( const FixedPoint< IntSize, FracSize, Signed > &  o) const
inlineconstexprnoexcept

◆ operator>=() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator>= ( FixedPoint< OI, OF, S >  o) const
inlineconstexprnoexcept

◆ operator>>()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator>> ( StorageType  v) const
inlineconstexpr

◆ operator>>=()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator>>= ( StorageType  v)
inlineconstexpr

◆ operator^() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator^ ( FixedPoint< IntSize, FracSize, Signed >  o) const
inlineconstexpr

◆ operator^() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator^ ( FixedPoint< OI, OF, S >  o) const
inlineconstexpr

◆ operator^=() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator^= ( FixedPoint< IntSize, FracSize, Signed >  o)
inlineconstexpr

◆ operator^=() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator^= ( FixedPoint< OI, OF, S >  o)
inlineconstexpr

◆ operator|() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator| ( FixedPoint< IntSize, FracSize, Signed >  o) const
inlineconstexpr

◆ operator|() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr auto FixedPoint< IntSize, FracSize, Signed >::operator| ( FixedPoint< OI, OF, S >  o) const
inlineconstexpr

◆ operator|=() [1/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator|= ( FixedPoint< IntSize, FracSize, Signed >  o)
inlineconstexpr

◆ operator|=() [2/2]

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
template<intmax_t OI, intmax_t OF, bool S>
constexpr FixedPoint& FixedPoint< IntSize, FracSize, Signed >::operator|= ( FixedPoint< OI, OF, S >  o)
inlineconstexpr

◆ operator~()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr FixedPoint FixedPoint< IntSize, FracSize, Signed >::operator~ ( ) const
inlineconstexpr

◆ set()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr void FixedPoint< IntSize, FracSize, Signed >::set ( StorageType  value)
inlineconstexpr

Update the entire value.

◆ set_f()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr void FixedPoint< IntSize, FracSize, Signed >::set_f ( FracType  value)
inlineconstexpr

Update just the fractional portion.

◆ set_i()

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
constexpr void FixedPoint< IntSize, FracSize, Signed >::set_i ( IntType  value)
inlineconstexpr

Update just the integral portion.

Member Data Documentation

◆ f

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
FracType FixedPoint< IntSize, FracSize, Signed >::f

◆ i

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
IntType FixedPoint< IntSize, FracSize, Signed >::i

◆ val

template<intmax_t IntSize, intmax_t FracSize, bool Signed>
StorageType FixedPoint< IntSize, FracSize, Signed >::val

The documentation for this class was generated from the following file: