24-bit (16.8) signed fixed floating point number
More...
#include <sf24.hpp>
|
| | sf24 (short x) |
| | Implicit s16 to sf24 conversion. More...
|
| |
| | sf24 (short x, unsigned char frac) |
| | Builds a signed fixed number from its separate integral and fractional part. More...
|
| |
| short | get_int () const |
| | Gets integral part of number. More...
|
| |
| unsigned char | get_frac () const |
| | Gets fractional part of number. More...
|
| |
|
sf24 | operator+ (const sf24 &b) const |
| |
|
sf24 | operator- (const sf24 &b) const |
| |
|
sf24 | operator* (const sf24 &b) const |
| |
|
sf24 | operator- () const |
| |
|
sf24 & | operator+= (const sf24 &b) |
| |
|
sf24 & | operator-= (const sf24 &b) |
| |
| | operator int () const |
| | Explicit narrowing conversion to integral type (only the integral type is kept) More...
|
| |
| | operator short () const |
| | Explicit narrowing conversion to short integral type (only the integral type is kept) More...
|
| |
|
bool | operator< (const sf24 &b) const |
| |
|
bool | operator> (const sf24 &b) const |
| |
|
bool | operator<= (const sf24 &b) const |
| |
|
bool | operator>= (const sf24 &b) const |
| |
|
bool | operator== (const sf24 &b) const |
| |
|
bool | operator!= (const sf24 &b) const |
| |
| bool | in_range (const sf24 &min, const sf24 &max) const |
| | Checks if the number belongs to an interval. More...
|
| |
|
char * | to_string () const |
| |
|
sf24 | abs () const |
| |
24-bit (16.8) signed fixed floating point number
◆ sf24() [1/2]
| DSC::sf24::sf24 |
( |
short |
x | ) |
|
Implicit s16 to sf24 conversion.
- Parameters
-
| [in] | x | short number to be converted to sf24
|
◆ sf24() [2/2]
| DSC::sf24::sf24 |
( |
short |
x, |
|
|
unsigned char |
frac |
|
) |
| |
Builds a signed fixed number from its separate integral and fractional part.
- Parameters
-
| [in] | x | number integral part |
| [in] | frac | number fractional part
|
◆ get_frac()
| unsigned char DSC::sf24::get_frac |
( |
| ) |
const |
Gets fractional part of number.
- Returns
- number fractional part scaled to 256 and rounded to a full byte (128 = 0.5)
◆ get_int()
| short DSC::sf24::get_int |
( |
| ) |
const |
Gets integral part of number.
- Returns
- number integral part
◆ in_range()
| bool DSC::sf24::in_range |
( |
const sf24 & |
min, |
|
|
const sf24 & |
max |
|
) |
| const |
Checks if the number belongs to an interval.
- Parameters
-
| [in] | min | minimum target value |
| [in] | max | maximum target value |
- Returns
- true if the number is between the specified values, false otherwise
◆ operator int()
| DSC::sf24::operator int |
( |
| ) |
const |
|
explicit |
Explicit narrowing conversion to integral type (only the integral type is kept)
Usage
int y = (int)x;
24-bit (16.8) signed fixed floating point number
Definition: sf24.hpp:13
◆ operator short()
| DSC::sf24::operator short |
( |
| ) |
const |
|
explicit |
Explicit narrowing conversion to short integral type (only the integral type is kept)
Usage
The documentation for this class was generated from the following file: