MySQL 9.1.0
Source Code Documentation
|
my_decimal class limits 'decimal_t' type to what we need in MySQL. More...
#include <my_decimal.h>
Public Member Functions | |
my_decimal (const my_decimal &rhs) | |
my_decimal & | operator= (const my_decimal &rhs) |
void | init () |
my_decimal () | |
~my_decimal () | |
void | sanity_check () const |
bool | sign () const |
void | sign (bool s) |
uint | precision () const |
void | swap (my_decimal &rhs) |
Swap two my_decimal values. More... | |
int | check_result (uint, int result) const |
report result of decimal operation. More... | |
Private Attributes | |
std::array< decimal_digit_t, DECIMAL_BUFF_LENGTH > | buffer |
Additional Inherited Members | |
Public Attributes inherited from decimal_t | |
int | intg |
The number of decimal digits (NOT number of decimal_digit_t's !) before the point. More... | |
int | frac |
The number of decimal digits after the point. More... | |
int | len |
The length of buf (length of allocated space) in decimal_digit_t's, not in bytes. More... | |
bool | sign |
False means positive, true means negative. More... | |
decimal_digit_t * | buf |
An array of decimal_digit_t's. More... | |
my_decimal class limits 'decimal_t' type to what we need in MySQL.
It contains internally all necessary space needed by the instance so no extra memory is needed. Objects should be moved using copy CTOR or assignment operator, rather than memcpy/memmove.
|
inline |
|
inline |
|
inline |
int my_decimal::check_result | ( | uint | mask, |
int | result | ||
) | const |
report result of decimal operation.
mask | bitmask filtering result, most likely E_DEC_FATAL_ERROR |
result | decimal library return code (E_DEC_* see include/decimal.h) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Swap two my_decimal values.
|
private |