Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
|
A representation of the Spanner NUMERIC type: an exact decimal value with a maximum integer precision (kIntPrecision) and rounding to a maximum fractional precision (kFracPrecision). More...
#include <google/cloud/spanner/numeric.h>
Public Member Functions | |
Decimal () | |
A zero value. More... | |
Regular value type, supporting copy, assign, move. | |
Decimal (Decimal &&) noexcept=default | |
Decimal & | operator= (Decimal &&) noexcept=default |
Decimal (Decimal const &)=default | |
Decimal & | operator= (Decimal const &)=default |
std::string const & | ToString () const & |
Conversion to a decimal-string representation of the Decimal in one of the following forms: More... | |
std::string && | ToString () && |
Conversion to a decimal-string representation of the Decimal in one of the following forms: More... | |
Static Public Attributes | |
static bool const | kHasNaN |
Whether DecimalMode supports NaN values. More... | |
Integer and fractional precision of a <tt>Decimal</tt> value of the mode. | |
static std::size_t const | kIntPrecision |
static std::size_t const | kFracPrecision |
Backwards-compatibility constants. | |
| |
static constexpr std::size_t | kIntPrec = 29 |
static constexpr std::size_t | kFracPrec = 9 |
Friends | |
std::ostream & | operator<< (std::ostream &os, Decimal const &d) |
Outputs string representation of the Decimal to the provided stream. More... | |
Relational operators | |
bool | operator== (Decimal const &a, Decimal const &b) |
bool | operator!= (Decimal const &a, Decimal const &b) |
A representation of the Spanner NUMERIC type: an exact decimal value with a maximum integer precision (kIntPrecision) and rounding to a maximum fractional precision (kFracPrecision).
A Decimal
can be constructed from, and converted to a std::string
, a double
, or any integral type. See the MakeDecimal()
factory functions, the ToString()
member function, and the ToDouble()
/ToInteger()
free functions.
Decimal
values can be copied/assigned/moved, compared for equality, and streamed.
|
inline |
A zero value.
|
defaultnoexcept |
|
default |
|
defaultnoexcept |
|
default |
|
inline |
Conversion to a decimal-string representation of the Decimal
in one of the following forms:
Note: The string never includes an exponent field.
|
inline |
Conversion to a decimal-string representation of the Decimal
in one of the following forms:
Note: The string never includes an exponent field.
|
friend |
|
friend |
Outputs string representation of the Decimal
to the provided stream.
|
friend |
|
staticconstexpr |
|
static |
|
static |
Whether DecimalMode
supports NaN values.
|
staticconstexpr |
|
static |