The functions used to make new BCD_ints.
More...
The functions used to make new BCD_ints.
constructor
| BCD_int bcd_error |
( |
const BCD_error |
error, |
|
|
const BCD_error |
orig_error |
|
) |
| |
A shorthand way of making a BCD_int error object.
- Parameters
-
| [in] | error | The operation which generated the current error |
| [in] | orig_error | The operation which initially started generating errors |
- Returns
- A NaN value which has the associated error codes
- Attention
- All constructors may return NaN with error set to NO_MEM
| BCD_int BCD_from_ascii |
( |
const char *const |
str, |
|
|
const size_t |
digits, |
|
|
const bool |
negative |
|
) |
| |
- Parameters
-
| [in] | str | The ASCII string you would like to make an integer from, must be decimal numbers (0x30 - 0x39) |
| [in] | digits | The number of digits |
| [in] | negative | The sign you would like to apply to the resulting BCD_int |
- Returns
- A BCD_int representation of the given data
- Attention
- All constructors may return NaN with error set to NO_MEM
| BCD_int BCD_from_bytes |
( |
const unsigned char *const |
str, |
|
|
const size_t |
chars, |
|
|
const bool |
negative, |
|
|
const bool |
little_endian |
|
) |
| |
- Parameters
-
| [in] | str | The BCD bytes you would like to copy from |
| [in] | chars | The number of bytes |
| [in] | negative | The sign you would like to apply to the resulting BCD_int |
| [in] | little_endian | The byte order of the fed data (little endian is preferred) |
- Returns
- A BCD_int representation of the given data
- Attention
- All constructors may return NaN with error set to NO_MEM
- Parameters
-
| [in] | a | The BCD_int you would like to copy |
- Returns
- A copy of a
- Attention
- All constructors may return NaN with error set to NO_MEM
| BCD_int new_BCD_int1 |
( |
const intmax_t |
a | ) |
|
- Parameters
-
| [in] | a | The C integer you would like to convert to a BCD_int |
- Returns
- The BCD_int representation of a
- Attention
- All constructors may return NaN with error set to NO_MEM
| BCD_int new_BCD_int2 |
( |
uintmax_t |
a, |
|
|
const bool |
negative |
|
) |
| |
- Parameters
-
| [in] | a | The C integer you would like to convert to a BCD_int |
| [in] | negative | The sign of the C integer |
- Returns
- The BCD_int representation of a
- Attention
- All constructors may return NaN with error set to NO_MEM