|
| SFix () |
|
| SFix (float fl) |
|
| SFix (double fl) |
|
template<typename T > |
| SFix (T value, bool as_raw=false) |
|
template<int8_t _NI, int8_t _NF, uint64_t _RANGE> |
| SFix (const SFix< _NI, _NF, _RANGE > &uf) |
|
template<int8_t _NI, int8_t _NF, uint64_t _RANGE> |
| SFix (const UFix< _NI, _NF, _RANGE > &uf) |
|
template<int8_t _NI, int8_t _NF, uint64_t _RANGE> |
SFix< FixMathPrivate::neededSNIExtra(FixMathPrivate::FM_max(NI, _NI), FixMathPrivate::FM_max(NF, _NF), FixMathPrivate::rangeAdd(NF, _NF, RANGE, _RANGE)), FixMathPrivate::FM_max(NF, _NF), FixMathPrivate::rangeAdd(NF, _NF, RANGE, _RANGE)> | operator+ (const SFix< _NI, _NF, _RANGE > &op) const |
|
template<int8_t _NI, int8_t _NF, uint64_t _RANGE> |
SFix< FixMathPrivate::neededSNIExtra(FixMathPrivate::FM_max(NI, _NI), FixMathPrivate::FM_max(NF, _NF), FixMathPrivate::rangeAdd(NF, _NF, RANGE, _RANGE)), FixMathPrivate::FM_max(NF, _NF), FixMathPrivate::rangeAdd(NF, _NF, RANGE, _RANGE)> | operator- (const SFix< _NI, _NF, _RANGE > &op) const |
|
template<int8_t _NI, int8_t _NF, uint64_t _RANGE> |
SFix< FixMathPrivate::neededSNIExtra(FixMathPrivate::FM_max(NI, _NI), FixMathPrivate::FM_max(NF, _NF), FixMathPrivate::rangeAdd(NF, _NF, RANGE, _RANGE)), FixMathPrivate::FM_max(NF, _NF), FixMathPrivate::rangeAdd(NF, _NF, RANGE, _RANGE)> | operator- (const UFix< _NI, _NF, _RANGE > &op) const |
|
SFix< NI, NF, RANGE > | operator- () const |
|
template<int8_t _NI, int8_t _NF, uint64_t _RANGE> |
SFix< FixMathPrivate::neededSNIExtra(NI+_NI, NF+_NF, RANGE *_RANGE), NF+_NF, RANGE *_RANGE > | operator* (const SFix< _NI, _NF, _RANGE > &op) const |
|
SFix< NF, NI > | invFast () const |
|
template<int8_t _NF> |
SFix< NF, _NF > | inv () const |
|
SFix< NF, FixMathPrivate::FM_min(NI *2+NF, 62-NF)> | invAccurate () const |
|
SFix< NI, NF > | operator>> (const int8_t op) const |
|
template<int8_t op> |
SFix< FixMathPrivate::FM_max(NI-op, 0), NF+op, FixMathPrivate::rangeShift(NI, op, RANGE)> | sR () |
|
template<int8_t op> |
SFix< NI+op, FixMathPrivate::FM_max(NF-op, 0), FixMathPrivate::rangeShift(NF, op, RANGE)> | sL () |
|
template<int8_t _NI, int8_t _NF> |
bool | operator> (const SFix< _NI, _NF > &op) const |
|
template<int8_t _NI, int8_t _NF> |
bool | operator< (const SFix< _NI, _NF > &op) const |
|
template<int8_t _NI, int8_t _NF> |
bool | operator== (const SFix< _NI, _NF > &op) const |
|
template<int8_t _NI, int8_t _NF> |
bool | operator!= (const SFix< _NI, _NF > &op) const |
|
UFix< NI, NF, RANGE > | asUFix () const |
|
float | asFloat () const |
|
internal_type | asRaw () const |
|
int8_t | getNI () const |
|
int8_t | getNF () const |
|
template<int8_t NI, int8_t NF, uint64_t RANGE>
class SFix< NI, NF, RANGE >
Instanciate an signed fixed point math number.
- Parameters
-
NI | The number of bits encoding the integer part. The integral part can range into [-2^NI, 2^NI -1] |
NF | The number of bits encoding the fractional part |
RANGE | A purely internal parameter that keeps track of the range used by the type. Safer to not define it. |
- Note
- The total number of the underlying int will be NI+NF+1 in order to accomodate the sign. It follows that, if you want something that reproduces the behavior of a int8_t, it should be declared as SFix<7,0>.