8#ifndef INCLUDED_BDLDFP_DECIMALUTIL
9#define INCLUDED_BDLDFP_DECIMALUTIL
110#include <bdlscm_version.h>
123#include <bsl_optional.h>
124#include <bsl_string.h>
199 template <
class STRING_TYPE>
201 template <
class STRING_TYPE>
211 template <
class STRING_TYPE>
217 template <
class STRING_TYPE>
219 template <
class STRING_TYPE>
231 template <
class STRING_TYPE>
727 unsigned int *significand,
821 static const char *
flatten(
const char *cString);
822 static const char *
flatten(
char *cString);
826 static const char *
flatten(
const std::string&
string);
827#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
828 static const char *
flatten(
const std::pmr::string&
string);
837 template <
class TYPE>
838 static const char *
flatten(
const TYPE&);
921template <
class STRING_TYPE>
929template <
class STRING_TYPE>
937template <
class STRING_TYPE>
945template <
class STRING_TYPE>
954template <
class STRING_TYPE>
963template <
class STRING_TYPE>
1477 return string.c_str();
1483 return string.c_str();
1486#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
1490 return string.c_str();
1501template <
class TYPE>
1505 BSLMF_ASSERT((
"Unsupported parameter type." && !
sizeof(TYPE)));
static ValueType32 remainder(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:2645
static ValueType32 trunc(ValueType32 x)
Definition bdldfp_decimalimputil.h:2265
static ValueType32 log(ValueType32 x)
Definition bdldfp_decimalimputil.h:2471
static ValueType128 makeDecimalRaw128(unsigned long long int significand, int exponent)
static ValueType32 fma(ValueType32 x, ValueType32 y, ValueType32 z)
Definition bdldfp_decimalimputil.h:2302
static ValueType32 scaleB(ValueType32 value, int exponent)
Definition bdldfp_decimalimputil.h:3051
static ValueType32 pow(ValueType32 base, ValueType32 exp)
Definition bdldfp_decimalimputil.h:2066
static long long int llrint(ValueType32 x)
Definition bdldfp_decimalimputil.h:1924
static ValueType32 floor(ValueType32 x)
Definition bdldfp_decimalimputil.h:2160
static ValueType32 copySign(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:2399
static ValueType32 round(ValueType32 x)
Definition bdldfp_decimalimputil.h:2196
static ValueType32 fabs(ValueType32 x)
Definition bdldfp_decimalimputil.h:2339
static ValueType32 fmod(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:2606
static ValueType32 log10(ValueType32 x)
Definition bdldfp_decimalimputil.h:2561
static ValueType32 makeDecimalRaw32(int significand, int exponent)
Definition bdldfp_decimalimputil.h:2956
static ValueType32 logB(ValueType32 x)
Definition bdldfp_decimalimputil.h:2516
static ValueType64 makeDecimal64(int significand, int exponent)
static long int lround(ValueType32 x)
Definition bdldfp_decimalimputil.h:2232
static ValueType32 quantize(ValueType32 value, ValueType32 exponent)
Definition bdldfp_decimalimputil.h:1727
static ValueType32 sqrt(ValueType32 x)
Definition bdldfp_decimalimputil.h:2363
static int quantizeEqual(ValueType32 *x, ValueType32 y, int exponent)
Definition bdldfp_decimalimputil.h:1811
static ValueType64 makeDecimalRaw64(unsigned long long int significand, int exponent)
static ValueType32 nexttoward(ValueType32 from, ValueType128 to)
Definition bdldfp_decimalimputil.h:2012
static ValueType32 nextafter(ValueType32 from, ValueType32 to)
Definition bdldfp_decimalimputil.h:1958
static ValueType32 exp(ValueType32 x)
Definition bdldfp_decimalimputil.h:2426
static long int lrint(ValueType32 x)
Definition bdldfp_decimalimputil.h:1891
static bool sameQuantum(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:1870
static ValueType32 ceil(ValueType32 x)
Definition bdldfp_decimalimputil.h:2123
Definition bdldfp_decimal.h:3101
DecimalImpUtil::ValueType128 * data()
Return a modifiable pointer to the underlying implementation.
Definition bdldfp_decimal.h:6792
Definition bdldfp_decimal.h:765
DecimalImpUtil::ValueType32 * data()
Definition bdldfp_decimal.h:6030
Definition bdldfp_decimal.h:1890
DecimalImpUtil::ValueType64 * data()
Return a modifiable pointer to the underlying implementation.
Definition bdldfp_decimal.h:6425
Definition bdldfp_uint128.h:175
Definition bslstl_string.h:1252
Definition bslstl_stringref.h:374
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:231
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdldfp_decimal.h:747
Definition bdldfp_decimalutil.h:816
static const char * flatten(const char *cString)
Return the specified cString.
Definition bdldfp_decimalutil.h:1463
Definition bdldfp_decimalutil.h:138
static Decimal32 fabs(Decimal32 value)
Definition bdldfp_decimalutil.h:1422
static int classify(Decimal128 x)
static bool isNan(Decimal64 x)
static long int lround(Decimal32 x)
Definition bdldfp_decimalutil.h:1350
static int quantum(Decimal128 value)
static Decimal32 logB(Decimal32 x)
Definition bdldfp_decimalutil.h:1134
static int classify(Decimal32 x)
static bool isNan(Decimal128 x)
static int format(char *buffer, int length, Decimal128 value, const DecimalFormatConfig &cfg=DecimalFormatConfig())
static int parseDecimal64(Decimal64 *out, const char *str)
static Decimal32 trunc(Decimal32 x, unsigned int precision)
static bool isInf(Decimal64 x)
static bool isUnordered(Decimal64 x, Decimal64 y)
static Decimal64 trunc(Decimal64 x, unsigned int precision)
static Decimal32 sqrt(Decimal32 x)
Definition bdldfp_decimalutil.h:1440
static bool isNan(Decimal32 x)
static Decimal32 multiplyByPowerOf10(Decimal32 value, int exponent)
Definition bdldfp_decimalutil.h:975
static Decimal32 exp(Decimal32 x)
Definition bdldfp_decimalutil.h:1098
static int decompose(int *sign, unsigned int *significand, int *exponent, Decimal32 value)
static Decimal128 trunc(Decimal128 x, unsigned int precision)
static int parseDecimal128Exact(Decimal128 *out, const char *str)
static bool isUnordered(Decimal32 x, Decimal32 y)
static Decimal32 log(Decimal32 x)
Definition bdldfp_decimalutil.h:1116
static bool isInf(Decimal128 x)
static bool isNormal(Decimal32 x)
static bool isUnordered(Decimal128 x, Decimal128 y)
static int decompose(int *sign, Uint128 *significand, int *exponent, Decimal128 value)
static Decimal32 makeDecimalRaw32(int significand, int exponent)
Definition bdldfp_decimalutil.h:851
static int quantum(Decimal64 value)
static Decimal128 makeDecimalRaw128(int significand, int exponent)
Definition bdldfp_decimalutil.h:877
static int parseDecimal32Exact(Decimal32 *out, const char *str)
static int classify(Decimal64 x)
static Decimal32 quantize(Decimal32 value, Decimal32 exponent)
Definition bdldfp_decimalutil.h:993
static bool isFinite(Decimal64 x)
static long long int llrint(Decimal32 x)
Definition bdldfp_decimalutil.h:1224
static Decimal32 ceil(Decimal32 x)
Definition bdldfp_decimalutil.h:1296
static int quantizeEqual(Decimal32 *x, Decimal32 y, int exponent)
Definition bdldfp_decimalutil.h:1035
static int parseDecimal32(Decimal32 *out, const char *str)
static Decimal64 makeDecimalRaw64(int significand, int exponent)
Definition bdldfp_decimalutil.h:856
static Decimal32 round(Decimal32 x)
Definition bdldfp_decimalutil.h:1332
static int format(char *buffer, int length, Decimal32 value, const DecimalFormatConfig &cfg=DecimalFormatConfig())
static Decimal32 fma(Decimal32 x, Decimal32 y, Decimal32 z)
Definition bdldfp_decimalutil.h:1404
static int quantum(Decimal32 value)
static Decimal64 makeDecimal64(int significand, int exponent)
Definition bdldfp_decimalutil.h:900
static bool isFinite(Decimal128 x)
static int parseDecimal64Exact(Decimal64 *out, const char *str)
static Decimal32 trunc(Decimal32 x)
Definition bdldfp_decimalutil.h:1386
static bool isFinite(Decimal32 x)
static long int lrint(Decimal32 x)
Definition bdldfp_decimalutil.h:1206
static bool isInf(Decimal32 x)
static Decimal32 copySign(Decimal32 x, Decimal32 y)
Definition bdldfp_decimalutil.h:1080
static bool isNormal(Decimal64 x)
static int decompose(int *sign, bsls::Types::Uint64 *significand, int *exponent, Decimal64 value)
static Decimal32 log10(Decimal32 x)
Definition bdldfp_decimalutil.h:1152
static Decimal32 pow(Decimal32 base, Decimal32 exp)
Definition bdldfp_decimalutil.h:1278
static Decimal32 fmod(Decimal32 x, Decimal32 y)
Definition bdldfp_decimalutil.h:1170
static bool sameQuantum(Decimal32 x, Decimal32 y)
Definition bdldfp_decimalutil.h:1062
static Decimal32 nextafter(Decimal32 from, Decimal32 to)
Definition bdldfp_decimalutil.h:1242
static Decimal32 floor(Decimal32 x)
Definition bdldfp_decimalutil.h:1314
static int format(char *buffer, int length, Decimal64 value, const DecimalFormatConfig &cfg=DecimalFormatConfig())
static bool isNormal(Decimal128 x)
static Decimal32 remainder(Decimal32 x, Decimal32 y)
Definition bdldfp_decimalutil.h:1188
static Decimal32 nexttoward(Decimal32 from, Decimal128 to)
Definition bdldfp_decimalutil.h:1260
static int parseDecimal128(Decimal128 *out, const char *str)
unsigned long long Uint64
Definition bsls_types.h:139