Iros
 
Loading...
Searching...
No Matches
di::math::FixedSigned< bits > Class Template Reference

A fixed-width signed integer. More...

#include <di/math/bigint/fixed_signed.h>

Public Member Functions

 FixedSigned ()=default
 
constexpr FixedSigned (bigint::StorageType value)
 
constexpr auto operator/ (FixedSigned const &divisor) const -> FixedSigned
 
constexpr auto operator% (FixedSigned const &divisor) const -> FixedSigned
 
constexpr auto operator- () const -> FixedSigned
 

Friends

constexpr friend auto operator== (FixedSigned const &a, FixedSigned const &b) -> bool
 
constexpr friend auto operator<=> (FixedSigned const &a, FixedSigned const &b)
 

Detailed Description

template<usize bits>
requires (bits % sizeof(bigint::StorageType) == 0)
class di::math::FixedSigned< bits >

A fixed-width signed integer.

Template Parameters
bitsThe number of bits in the integer.
Note
This can be used fallback implementation for when the compiler doesn't support 128-bit integers. As such, its internal layout must by ABI compatible with the compiler's 128-bit integer type.

Constructor & Destructor Documentation

◆ FixedSigned() [1/2]

template<usize bits>
di::math::FixedSigned< bits >::FixedSigned ( )
default

◆ FixedSigned() [2/2]

template<usize bits>
di::math::FixedSigned< bits >::FixedSigned ( bigint::StorageType value)
inlineconstexpr

Member Function Documentation

◆ operator%()

template<usize bits>
auto di::math::FixedSigned< bits >::operator% ( FixedSigned< bits > const & divisor) const -> FixedSigned
inlineconstexpr

◆ operator-()

template<usize bits>
auto di::math::FixedSigned< bits >::operator- ( ) const -> FixedSigned
inlineconstexpr

◆ operator/()

template<usize bits>
auto di::math::FixedSigned< bits >::operator/ ( FixedSigned< bits > const & divisor) const -> FixedSigned
inlineconstexpr

Friends And Related Symbol Documentation

◆ operator<=>

template<usize bits>
friend auto operator<=> ( FixedSigned< bits > const & a,
FixedSigned< bits > const & b )
friend

◆ operator==

template<usize bits>
friend auto operator== ( FixedSigned< bits > const & a,
FixedSigned< bits > const & b ) -> bool
friend

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