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>
194 template <
class STRING_TYPE>
196 template <
class STRING_TYPE>
206 template <
class STRING_TYPE>
212 template <
class STRING_TYPE>
214 template <
class STRING_TYPE>
226 template <
class STRING_TYPE>
707 unsigned int *significand,
804 static const char *
flatten(
const char *cString);
805 static const char *
flatten(
char *cString);
809 static const char *
flatten(
const std::string&
string);
810#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
811 static const char *
flatten(
const std::pmr::string&
string);
820 template <
class TYPE>
821 static const char *
flatten(
const TYPE&);
904template <
class STRING_TYPE>
912template <
class STRING_TYPE>
920template <
class STRING_TYPE>
928template <
class STRING_TYPE>
937template <
class STRING_TYPE>
946template <
class STRING_TYPE>
1460 return string.c_str();
1466 return string.c_str();
1469#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
1473 return string.c_str();
1484template <
class TYPE>
1488 BSLMF_ASSERT((
"Unsupported parameter type." && !
sizeof(TYPE)));
static ValueType32 remainder(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:2639
static ValueType32 trunc(ValueType32 x)
Definition bdldfp_decimalimputil.h:2259
static ValueType32 log(ValueType32 x)
Definition bdldfp_decimalimputil.h:2465
static ValueType128 makeDecimalRaw128(unsigned long long int significand, int exponent)
static ValueType32 fma(ValueType32 x, ValueType32 y, ValueType32 z)
Definition bdldfp_decimalimputil.h:2296
static ValueType32 scaleB(ValueType32 value, int exponent)
Definition bdldfp_decimalimputil.h:3045
static ValueType32 pow(ValueType32 base, ValueType32 exp)
Definition bdldfp_decimalimputil.h:2060
static long long int llrint(ValueType32 x)
Definition bdldfp_decimalimputil.h:1918
static ValueType32 floor(ValueType32 x)
Definition bdldfp_decimalimputil.h:2154
static ValueType32 copySign(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:2393
static ValueType32 round(ValueType32 x)
Definition bdldfp_decimalimputil.h:2190
static ValueType32 fabs(ValueType32 x)
Definition bdldfp_decimalimputil.h:2333
static ValueType32 fmod(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:2600
static ValueType32 log10(ValueType32 x)
Definition bdldfp_decimalimputil.h:2555
static ValueType32 makeDecimalRaw32(int significand, int exponent)
Definition bdldfp_decimalimputil.h:2950
static ValueType32 logB(ValueType32 x)
Definition bdldfp_decimalimputil.h:2510
static ValueType64 makeDecimal64(int significand, int exponent)
static long int lround(ValueType32 x)
Definition bdldfp_decimalimputil.h:2226
static ValueType32 quantize(ValueType32 value, ValueType32 exponent)
Definition bdldfp_decimalimputil.h:1721
static ValueType32 sqrt(ValueType32 x)
Definition bdldfp_decimalimputil.h:2357
static int quantizeEqual(ValueType32 *x, ValueType32 y, int exponent)
Definition bdldfp_decimalimputil.h:1805
static ValueType64 makeDecimalRaw64(unsigned long long int significand, int exponent)
static ValueType32 nexttoward(ValueType32 from, ValueType128 to)
Definition bdldfp_decimalimputil.h:2006
static ValueType32 nextafter(ValueType32 from, ValueType32 to)
Definition bdldfp_decimalimputil.h:1952
static ValueType32 exp(ValueType32 x)
Definition bdldfp_decimalimputil.h:2420
static long int lrint(ValueType32 x)
Definition bdldfp_decimalimputil.h:1885
static bool sameQuantum(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:1864
static ValueType32 ceil(ValueType32 x)
Definition bdldfp_decimalimputil.h:2117
Definition bdldfp_decimal.h:3023
DecimalImpUtil::ValueType128 * data()
Return a modifiable pointer to the underlying implementation.
Definition bdldfp_decimal.h:6430
Definition bdldfp_decimal.h:730
DecimalImpUtil::ValueType32 * data()
Definition bdldfp_decimal.h:5668
Definition bdldfp_decimal.h:1834
DecimalImpUtil::ValueType64 * data()
Return a modifiable pointer to the underlying implementation.
Definition bdldfp_decimal.h:6063
Definition bdldfp_uint128.h:175
Definition bslstl_string.h:1281
Definition bslstl_stringref.h:372
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdldfp_decimal.h:712
Definition bdldfp_decimalutil.h:799
static const char * flatten(const char *cString)
Return the specified cString.
Definition bdldfp_decimalutil.h:1446
Definition bdldfp_decimalutil.h:136
static Decimal32 fabs(Decimal32 value)
Definition bdldfp_decimalutil.h:1405
static int classify(Decimal128 x)
static bool isNan(Decimal64 x)
static long int lround(Decimal32 x)
Definition bdldfp_decimalutil.h:1333
static int quantum(Decimal128 value)
static Decimal32 logB(Decimal32 x)
Definition bdldfp_decimalutil.h:1117
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:1423
static bool isNan(Decimal32 x)
static Decimal32 multiplyByPowerOf10(Decimal32 value, int exponent)
Definition bdldfp_decimalutil.h:958
static Decimal32 exp(Decimal32 x)
Definition bdldfp_decimalutil.h:1081
static int decompose(int *sign, unsigned int *significand, int *exponent, Decimal32 value)
static Decimal128 trunc(Decimal128 x, unsigned int precision)
Examples: trunc(3.14159, 3) ==> 3.141.
static int parseDecimal128Exact(Decimal128 *out, const char *str)
static bool isUnordered(Decimal32 x, Decimal32 y)
static Decimal32 log(Decimal32 x)
Definition bdldfp_decimalutil.h:1099
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:834
static int quantum(Decimal64 value)
static Decimal128 makeDecimalRaw128(int significand, int exponent)
Definition bdldfp_decimalutil.h:860
static int parseDecimal32Exact(Decimal32 *out, const char *str)
static int classify(Decimal64 x)
static Decimal32 quantize(Decimal32 value, Decimal32 exponent)
Definition bdldfp_decimalutil.h:976
static bool isFinite(Decimal64 x)
static long long int llrint(Decimal32 x)
Definition bdldfp_decimalutil.h:1207
static Decimal32 ceil(Decimal32 x)
Definition bdldfp_decimalutil.h:1279
static int quantizeEqual(Decimal32 *x, Decimal32 y, int exponent)
Definition bdldfp_decimalutil.h:1018
static int parseDecimal32(Decimal32 *out, const char *str)
static Decimal64 makeDecimalRaw64(int significand, int exponent)
Definition bdldfp_decimalutil.h:839
static Decimal32 round(Decimal32 x)
Definition bdldfp_decimalutil.h:1315
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:1387
static int quantum(Decimal32 value)
static Decimal64 makeDecimal64(int significand, int exponent)
Definition bdldfp_decimalutil.h:883
static bool isFinite(Decimal128 x)
static int parseDecimal64Exact(Decimal64 *out, const char *str)
static Decimal32 trunc(Decimal32 x)
Definition bdldfp_decimalutil.h:1369
static bool isFinite(Decimal32 x)
static long int lrint(Decimal32 x)
Definition bdldfp_decimalutil.h:1189
static bool isInf(Decimal32 x)
static Decimal32 copySign(Decimal32 x, Decimal32 y)
Definition bdldfp_decimalutil.h:1063
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:1135
static Decimal32 pow(Decimal32 base, Decimal32 exp)
Definition bdldfp_decimalutil.h:1261
static Decimal32 fmod(Decimal32 x, Decimal32 y)
Definition bdldfp_decimalutil.h:1153
static bool sameQuantum(Decimal32 x, Decimal32 y)
Definition bdldfp_decimalutil.h:1045
static Decimal32 nextafter(Decimal32 from, Decimal32 to)
Definition bdldfp_decimalutil.h:1225
static Decimal32 floor(Decimal32 x)
Definition bdldfp_decimalutil.h:1297
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:1171
static Decimal32 nexttoward(Decimal32 from, Decimal128 to)
Definition bdldfp_decimalutil.h:1243
static int parseDecimal128(Decimal128 *out, const char *str)
unsigned long long Uint64
Definition bsls_types.h:137