9#ifndef INCLUDED_BDLDFP_DECIMALIMPUTIL
10#define INCLUDED_BDLDFP_DECIMALIMPUTIL
171#include <bdlscm_version.h>
186#include <bsl_algorithm.h>
187#include <bsl_cmath.h>
188#include <bsl_c_errno.h>
189#include <bsl_iostream.h>
191#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
192#include <bsl_c_signal.h>
195#ifdef BDLDFP_DECIMALPLATFORM_SOFTWARE
200#define BDLDFP_DECIMALIMPUTIL_DF(lit) \
201 BloombergLP::bdldfp::DecimalImpUtil::parse32( \
202 (BloombergLP::bdldfp::DecimalImpUtil::checkLiteral(lit), #lit))
204#define BDLDFP_DECIMALIMPUTIL_DD(lit) \
205 BloombergLP::bdldfp::DecimalImpUtil::parse64( \
206 (BloombergLP::bdldfp::DecimalImpUtil::checkLiteral(lit), #lit))
208#define BDLDFP_DECIMALIMPUTIL_DL(lit) \
209 BloombergLP::bdldfp::DecimalImpUtil::parse128( \
210 (BloombergLP::bdldfp::DecimalImpUtil::checkLiteral(lit), #lit))
212#elif defined(BDLDFP_DECIMALPLATFORM_C99_TR) || defined( __IBM_DFP__ )
214#define BDLDFP_DECIMALIMPUTIL_JOIN_(a,b) a##b
218#define BDLDFP_DECIMALIMPUTIL_DF(lit) BDLDFP_DECIMALIMPUTIL_JOIN_(lit,df)
220#define BDLDFP_DECIMALIMPUTIL_DD(lit) BDLDFP_DECIMALIMPUTIL_JOIN_(lit,dd)
222#define BDLDFP_DECIMALIMPUTIL_DL(lit) BDLDFP_DECIMALIMPUTIL_JOIN_(lit,dl)
241#if defined(BDLDFP_DECIMALPLATFORM_INTELDFP)
242 typedef DecimalImpUtil_IntelDfp Imp;
244 BDLDFP_DECIMALPLATFORM_COMPILER_ERROR;
283#ifdef BDLDFP_DECIMALPLATFORM_SOFTWARE
289 struct This_is_not_a_floating_point_literal {};
294 template <
class TYPE>
295 static void checkLiteral(
const TYPE& t);
299 static void checkLiteral(
double);
301#elif defined(BDLDFP_DECIMALPLATFORM_HARDWARE)
305#error Improperly configured decimal floating point platform settings
432 unsigned int *significand,
1509#ifdef BDLDFP_DECIMALPLATFORM_SOFTWARE
1511template <
class TYPE>
1513void DecimalImpUtil::checkLiteral(
const TYPE& t)
1515 (void)
static_cast<This_is_not_a_floating_point_literal
>(t);
1519void DecimalImpUtil::checkLiteral(
double)
1532 return Imp::int32ToDecimal32(value);
1538 return Imp::int32ToDecimal64(value);
1544 return Imp::int32ToDecimal128(value);
1552 return Imp::uint32ToDecimal32(value);
1559 return Imp::uint32ToDecimal64(value);
1566 return Imp::uint32ToDecimal128(value);
1574 return Imp::int64ToDecimal32(value);
1581 return Imp::int64ToDecimal64(value);
1588 return Imp::int64ToDecimal128(value);
1596 return Imp::uint64ToDecimal32(value);
1603 return Imp::uint64ToDecimal64(value);
1610 return Imp::uint64ToDecimal128(value);
1622 return Imp::add(lhs, rhs);
1630 return Imp::add(lhs, rhs);
1637 return Imp::add(lhs, rhs);
1647 return Imp::subtract(lhs, rhs);
1655 return Imp::subtract(lhs, rhs);
1663 return Imp::subtract(lhs, rhs);
1673 return Imp::multiply(lhs, rhs);
1681 return Imp::multiply(lhs, rhs);
1689 return Imp::multiply(lhs, rhs);
1701 return Imp::divide(lhs, rhs);
1709 return Imp::divide(lhs, rhs);
1717 return Imp::divide(lhs, rhs);
1725 _IDEC_flags flags(0);
1726 retval.d_raw = __bid32_quantize(value.d_raw,
1737 _IDEC_flags flags(0);
1738 retval.d_raw = __bid64_quantize(value.d_raw,
1749 _IDEC_flags flags(0);
1750 retval.d_raw = __bid128_quantize(value.d_raw,
1767 _IDEC_flags flags(0);
1768 retval.d_raw = __bid32_quantize(value.d_raw, exp.d_raw, &flags);
1783 _IDEC_flags flags(0);
1784 retval.d_raw = __bid64_quantize(value.d_raw, exp.d_raw, &flags);
1799 _IDEC_flags flags(0);
1800 retval.d_raw = __bid128_quantize(value.d_raw, exp.d_raw, &flags);
1815 _IDEC_flags flags(0);
1816 retval.d_raw = __bid32_quantize(y.d_raw, exp.d_raw, &flags);
1834 _IDEC_flags flags(0);
1835 retval.d_raw = __bid64_quantize(y.d_raw, exp.d_raw, &flags);
1854 _IDEC_flags flags(0);
1855 retval.d_raw = __bid128_quantize(y.d_raw, exp.d_raw, &flags);
1866 return __bid32_sameQuantum(x.d_raw, y.d_raw);
1872 return __bid64_sameQuantum(x.d_raw, y.d_raw);
1878 return __bid128_sameQuantum(x.d_raw, y.d_raw);
1887 _IDEC_flags flags(0);
1888 long int ret = __bid32_lrint(x.d_raw, &flags);
1889 if (BID_INVALID_EXCEPTION & flags) {
1898 _IDEC_flags flags(0);
1899 long int ret = __bid64_lrint(x.d_raw, &flags);
1900 if (BID_INVALID_EXCEPTION & flags) {
1909 _IDEC_flags flags(0);
1910 long int ret = __bid128_lrint(x.d_raw, &flags);
1911 if (BID_INVALID_EXCEPTION & flags) {
1920 _IDEC_flags flags(0);
1921 long long int ret = __bid32_llrint(x.d_raw, &flags);
1922 if (BID_INVALID_EXCEPTION & flags) {
1931 _IDEC_flags flags(0);
1932 long long int ret = __bid64_llrint(x.d_raw, &flags);
1933 if (BID_INVALID_EXCEPTION & flags) {
1942 _IDEC_flags flags(0);
1943 long long int ret = __bid128_llrint(x.d_raw, &flags);
1944 if (BID_INVALID_EXCEPTION & flags) {
1955 _IDEC_flags flags(0);
1956 retval.d_raw = __bid32_nextafter(x.d_raw, y.d_raw, &flags);
1957 if (BID_OVERFLOW_EXCEPTION & flags ||
1958 BID_UNDERFLOW_EXCEPTION & flags)
1962 if (BID_INVALID_EXCEPTION & flags) {
1973 _IDEC_flags flags(0);
1974 retval.d_raw = __bid64_nextafter(x.d_raw, y.d_raw, &flags);
1975 if (BID_OVERFLOW_EXCEPTION & flags ||
1976 BID_UNDERFLOW_EXCEPTION & flags)
1980 if (BID_INVALID_EXCEPTION & flags) {
1991 _IDEC_flags flags(0);
1992 retval.d_raw = __bid128_nextafter(x.d_raw, y.d_raw, &flags);
1993 if (BID_OVERFLOW_EXCEPTION & flags ||
1994 BID_UNDERFLOW_EXCEPTION & flags)
1998 if (BID_INVALID_EXCEPTION & flags) {
2009 _IDEC_flags flags(0);
2010 retval.d_raw = __bid32_nexttoward(x.d_raw, y.d_raw, &flags);
2011 if (BID_OVERFLOW_EXCEPTION & flags ||
2012 BID_UNDERFLOW_EXCEPTION & flags)
2016 if (BID_INVALID_EXCEPTION & flags) {
2027 _IDEC_flags flags(0);
2028 retval.d_raw = __bid64_nexttoward(x.d_raw, y.d_raw, &flags);
2029 if (BID_OVERFLOW_EXCEPTION & flags ||
2030 BID_UNDERFLOW_EXCEPTION & flags)
2034 if (BID_INVALID_EXCEPTION & flags) {
2045 _IDEC_flags flags(0);
2046 retval.d_raw = __bid128_nexttoward(x.d_raw, y.d_raw, &flags);
2047 if (BID_OVERFLOW_EXCEPTION & flags ||
2048 BID_UNDERFLOW_EXCEPTION & flags)
2052 if (BID_INVALID_EXCEPTION & flags) {
2063 _IDEC_flags flags(0);
2064 retval.d_raw = __bid32_pow(base.d_raw, exp.d_raw, &flags);
2065 if (BID_OVERFLOW_EXCEPTION & flags ||
2066 BID_UNDERFLOW_EXCEPTION & flags ||
2067 BID_ZERO_DIVIDE_EXCEPTION & flags)
2071 if (BID_INVALID_EXCEPTION & flags) {
2082 _IDEC_flags flags(0);
2083 retval.d_raw = __bid64_pow(base.d_raw, exp.d_raw, &flags);
2084 if (BID_OVERFLOW_EXCEPTION & flags ||
2085 BID_UNDERFLOW_EXCEPTION & flags ||
2086 BID_ZERO_DIVIDE_EXCEPTION & flags)
2090 if (BID_INVALID_EXCEPTION & flags) {
2102 _IDEC_flags flags(0);
2103 retval.d_raw = __bid128_pow(base.d_raw, exp.d_raw, &flags);
2104 if (BID_OVERFLOW_EXCEPTION & flags ||
2105 BID_UNDERFLOW_EXCEPTION & flags ||
2106 BID_ZERO_DIVIDE_EXCEPTION & flags)
2110 if (BID_INVALID_EXCEPTION & flags) {
2120 _IDEC_flags flags(0);
2121 retval.d_raw = __bid32_round_integral_positive(x.d_raw, &flags);
2122 if (BID_INVALID_EXCEPTION & flags) {
2132 _IDEC_flags flags(0);
2133 retval.d_raw = __bid64_round_integral_positive(x.d_raw, &flags);
2134 if (BID_INVALID_EXCEPTION & flags) {
2144 _IDEC_flags flags(0);
2145 retval.d_raw = __bid128_round_integral_positive(x.d_raw, &flags);
2146 if (BID_INVALID_EXCEPTION & flags) {
2157 _IDEC_flags flags(0);
2158 retval.d_raw = __bid32_round_integral_negative(x.d_raw, &flags);
2159 if (BID_INVALID_EXCEPTION & flags) {
2169 _IDEC_flags flags(0);
2170 retval.d_raw = __bid64_round_integral_negative(x.d_raw, &flags);
2171 if (BID_INVALID_EXCEPTION & flags) {
2181 _IDEC_flags flags(0);
2182 retval.d_raw = __bid128_round_integral_negative(x.d_raw, &flags);
2183 if (BID_INVALID_EXCEPTION & flags) {
2193 _IDEC_flags flags(0);
2194 retval.d_raw = __bid32_round_integral_nearest_away(x.d_raw, &flags);
2195 if (BID_INVALID_EXCEPTION & flags) {
2205 _IDEC_flags flags(0);
2206 retval.d_raw = __bid64_round_integral_nearest_away(x.d_raw, &flags);
2207 if (BID_INVALID_EXCEPTION & flags) {
2217 _IDEC_flags flags(0);
2218 retval.d_raw = __bid128_round_integral_nearest_away(x.d_raw, &flags);
2219 if (BID_INVALID_EXCEPTION & flags) {
2228 _IDEC_flags flags(0);
2229 long int rv = __bid32_lround(x.d_raw, &flags);
2230 if (BID_INVALID_EXCEPTION & flags) {
2239 _IDEC_flags flags(0);
2240 long int rv = __bid64_lround(x.d_raw, &flags);
2241 if (BID_INVALID_EXCEPTION & flags) {
2250 _IDEC_flags flags(0);
2251 long int rv = __bid128_lround(x.d_raw, &flags);
2252 if (BID_INVALID_EXCEPTION & flags) {
2262 _IDEC_flags flags(0);
2263 retval.d_raw = __bid32_round_integral_zero(x.d_raw, &flags);
2264 if (BID_INVALID_EXCEPTION & flags) {
2274 _IDEC_flags flags(0);
2275 retval.d_raw = __bid64_round_integral_zero(x.d_raw, &flags);
2276 if (BID_INVALID_EXCEPTION & flags) {
2286 _IDEC_flags flags(0);
2287 retval.d_raw = __bid128_round_integral_zero(x.d_raw, &flags);
2288 if (BID_INVALID_EXCEPTION & flags) {
2299 _IDEC_flags flags(0);
2300 rv.d_raw = __bid32_fma(x.d_raw, y.d_raw, z.d_raw, &flags);
2301 if (BID_INVALID_EXCEPTION & flags) {
2311 _IDEC_flags flags(0);
2312 rv.d_raw = __bid64_fma(x.d_raw, y.d_raw, z.d_raw, &flags);
2313 if (BID_INVALID_EXCEPTION & flags) {
2323 _IDEC_flags flags(0);
2324 rv.d_raw = __bid128_fma(x.d_raw, y.d_raw, z.d_raw, &flags);
2325 if (BID_INVALID_EXCEPTION & flags) {
2336 rv.d_raw = __bid32_abs(value.d_raw);
2344 rv.d_raw = __bid64_abs(value.d_raw);
2352 rv.d_raw = __bid128_abs(value.d_raw);
2360 _IDEC_flags flags(0);
2361 rv.d_raw = __bid32_sqrt(value.d_raw, &flags);
2362 if (BID_INVALID_EXCEPTION & flags) {
2372 _IDEC_flags flags(0);
2373 rv.d_raw = __bid64_sqrt(value.d_raw, &flags);
2374 if (BID_INVALID_EXCEPTION & flags) {
2384 _IDEC_flags flags(0);
2385 rv.d_raw = __bid128_sqrt(value.d_raw, &flags);
2386 if (BID_INVALID_EXCEPTION & flags) {
2397 rv.d_raw = __bid32_copySign(x.d_raw, y.d_raw);
2406 rv.d_raw = __bid64_copySign(x.d_raw, y.d_raw);
2415 rv.d_raw = __bid128_copySign(x.d_raw, y.d_raw);
2423 _IDEC_flags flags(0);
2424 rv.d_raw = __bid32_exp(value.d_raw, &flags);
2425 if (BID_INVALID_EXCEPTION & flags) {
2428 if (BID_OVERFLOW_EXCEPTION & flags) {
2438 _IDEC_flags flags(0);
2439 rv.d_raw = __bid64_exp(value.d_raw, &flags);
2440 if (BID_INVALID_EXCEPTION & flags) {
2443 if (BID_OVERFLOW_EXCEPTION & flags) {
2453 _IDEC_flags flags(0);
2454 rv.d_raw = __bid128_exp(value.d_raw, &flags);
2455 if (BID_INVALID_EXCEPTION & flags) {
2458 if (BID_OVERFLOW_EXCEPTION & flags) {
2468 _IDEC_flags flags(0);
2469 rv.d_raw = __bid32_log(value.d_raw, &flags);
2470 if (BID_INVALID_EXCEPTION & flags) {
2473 if (BID_ZERO_DIVIDE_EXCEPTION & flags) {
2483 _IDEC_flags flags(0);
2484 rv.d_raw = __bid64_log(value.d_raw, &flags);
2485 if (BID_INVALID_EXCEPTION & flags) {
2488 if (BID_ZERO_DIVIDE_EXCEPTION & flags) {
2498 _IDEC_flags flags(0);
2499 rv.d_raw = __bid128_log(value.d_raw, &flags);
2500 if (BID_INVALID_EXCEPTION & flags) {
2503 if (BID_ZERO_DIVIDE_EXCEPTION & flags) {
2513 _IDEC_flags flags(0);
2514 rv.d_raw = __bid32_logb(value.d_raw, &flags);
2515 if (BID_INVALID_EXCEPTION & flags) {
2518 if (BID_ZERO_DIVIDE_EXCEPTION & flags) {
2528 _IDEC_flags flags(0);
2529 rv.d_raw = __bid64_logb(value.d_raw, &flags);
2530 if (BID_INVALID_EXCEPTION & flags) {
2533 if (BID_ZERO_DIVIDE_EXCEPTION & flags) {
2543 _IDEC_flags flags(0);
2544 rv.d_raw = __bid128_logb(value.d_raw, &flags);
2545 if (BID_INVALID_EXCEPTION & flags) {
2548 if (BID_ZERO_DIVIDE_EXCEPTION & flags) {
2558 _IDEC_flags flags(0);
2559 rv.d_raw = __bid32_log10(value.d_raw, &flags);
2560 if (BID_INVALID_EXCEPTION & flags) {
2563 if (BID_ZERO_DIVIDE_EXCEPTION & flags) {
2573 _IDEC_flags flags(0);
2574 rv.d_raw = __bid64_log10(value.d_raw, &flags);
2575 if (BID_INVALID_EXCEPTION & flags) {
2578 if (BID_ZERO_DIVIDE_EXCEPTION & flags) {
2588 _IDEC_flags flags(0);
2589 rv.d_raw = __bid128_log10(value.d_raw, &flags);
2590 if (BID_INVALID_EXCEPTION & flags) {
2593 if (BID_ZERO_DIVIDE_EXCEPTION & flags) {
2604 _IDEC_flags flags(0);
2605 rv.d_raw = __bid32_fmod(x.d_raw, y.d_raw, &flags);
2606 if (BID_INVALID_EXCEPTION & flags) {
2617 _IDEC_flags flags(0);
2618 rv.d_raw = __bid64_fmod(x.d_raw, y.d_raw, &flags);
2619 if (BID_INVALID_EXCEPTION & flags) {
2630 _IDEC_flags flags(0);
2631 rv.d_raw = __bid128_fmod(x.d_raw, y.d_raw, &flags);
2632 if (BID_INVALID_EXCEPTION & flags) {
2643 _IDEC_flags flags(0);
2644 rv.d_raw = __bid32_rem(x.d_raw, y.d_raw, &flags);
2645 if (BID_INVALID_EXCEPTION & flags) {
2656 _IDEC_flags flags(0);
2657 rv.d_raw = __bid64_rem(x.d_raw, y.d_raw, &flags);
2658 if (BID_INVALID_EXCEPTION & flags) {
2669 _IDEC_flags flags(0);
2670 rv.d_raw = __bid128_rem(x.d_raw, y.d_raw, &flags);
2671 if (BID_INVALID_EXCEPTION & flags) {
2683 return Imp::negate(value);
2690 return Imp::negate(value);
2697 return Imp::negate(value);
2709 return Imp::less(lhs, rhs);
2717 return Imp::less(lhs, rhs);
2725 return Imp::less(lhs, rhs);
2735 return Imp::greater(lhs, rhs);
2743 return Imp::greater(lhs, rhs);
2751 return Imp::greater(lhs, rhs);
2761 return Imp::lessEqual(lhs, rhs);
2769 return Imp::lessEqual(lhs, rhs);
2777 return Imp::lessEqual(lhs, rhs);
2787 return Imp::greaterEqual(lhs, rhs);
2795 return Imp::greaterEqual(lhs, rhs);
2803 return Imp::greaterEqual(lhs, rhs);
2813 return Imp::equal(lhs, rhs);
2821 return Imp::equal(lhs, rhs);
2829 return Imp::equal(lhs, rhs);
2839 return Imp::notEqual(lhs, rhs);
2847 return Imp::notEqual(lhs, rhs);
2855 return Imp::notEqual(lhs, rhs);
2864 return Imp::convertToDecimal32(input);
2871 return Imp::convertToDecimal32(input);
2878 return Imp::convertToDecimal64(input);
2885 return Imp::convertToDecimal64(input);
2892 return Imp::convertToDecimal128(input);
2899 return Imp::convertToDecimal128(input);
2908 return Imp::binaryToDecimal32(value);
2915 return Imp::binaryToDecimal32(value);
2922 return Imp::binaryToDecimal64(value);
2929 return Imp::binaryToDecimal64(value);
2936 return Imp::binaryToDecimal128(value);
2943 return Imp::binaryToDecimal128(value);
2954 BSLS_ASSERT(bsl::max(significand, -significand) <= 9999999);
2955 return Imp::makeDecimalRaw32(significand, exponent);
2967 return Imp::makeDecimalRaw64(significand, exponent);
2976 BSLS_ASSERT(std::max(significand, -significand) <= 9999999999999999LL);
2978 return Imp::makeDecimalRaw64(significand, exponent);
2988 return Imp::makeDecimalRaw64(significand, exponent);
2997 return Imp::makeDecimalRaw64(significand, exponent);
3008 return Imp::makeDecimalRaw128(significand, exponent);
3018 return Imp::makeDecimalRaw128(significand, exponent);
3028 return Imp::makeDecimalRaw128(significand, exponent);
3038 return Imp::makeDecimalRaw128(significand, exponent);
3048 _IDEC_flags flags(0);
3049 result.d_raw = __bid32_scalbn(value.d_raw, exponent, &flags);
3050 if (BID_INVALID_EXCEPTION & flags) {
3053 if (BID_OVERFLOW_EXCEPTION & flags) {
3064 _IDEC_flags flags(0);
3065 result.d_raw = __bid64_scalbn(value.d_raw, exponent, &flags);
3066 if (BID_INVALID_EXCEPTION & flags) {
3069 if (BID_OVERFLOW_EXCEPTION & flags) {
3080 _IDEC_flags flags(0);
3081 result.d_raw = __bid128_scalbn(value.d_raw, exponent, &flags);
3082 if (BID_INVALID_EXCEPTION & flags) {
3085 if (BID_OVERFLOW_EXCEPTION & flags) {
3096 return Imp::parse32(input);
3103 return Imp::parse64(input);
3110 return Imp::parse128(input);
3118 return Imp::parse32(input, status);
3126 return Imp::parse64(input, status);
3134 return Imp::parse128(input, status);
3142 return Imp::convertDPDtoBID(dpd);
3149 return Imp::convertDPDtoBID(dpd);
3156 return Imp::convertDPDtoBID(dpd);
3163 return Imp::convertBIDtoDPD(value);
3170 return Imp::convertBIDtoDPD(value);
3177 return Imp::convertBIDtoDPD(value);
3185 return Imp::convertFromBID(bid);
3192 return Imp::convertFromBID(bid);
3199 return Imp::convertFromBID(bid);
3206 return Imp::convertToBID(value);
3213 return Imp::convertToBID(value);
3220 return Imp::convertToBID(value);
Definition bdldfp_decimalimputil.h:238
static ValueType32 min32() BSLS_KEYWORD_NOEXCEPT
static ValueType32 remainder(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:2639
static ValueType32 trunc(ValueType32 x)
Definition bdldfp_decimalimputil.h:2259
static ValueType64 makeDecimal64(long long int significand, int exponent)
static ValueType32 log(ValueType32 x)
Definition bdldfp_decimalimputil.h:2465
static ValueType128 roundError128() BSLS_KEYWORD_NOEXCEPT
static ValueType128 int32ToDecimal128(int value)
Definition bdldfp_decimalimputil.h:1542
static ValueType64 convertToDecimal64(const ValueType32 &input)
Definition bdldfp_decimalimputil.h:2876
static ValueType128 denormMin128() BSLS_KEYWORD_NOEXCEPT
static ValueType32 normalize(ValueType32 original)
static bool lessEqual(ValueType32 lhs, ValueType32 rhs)
Definition bdldfp_decimalimputil.h:2758
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 ValueType64 max64() BSLS_KEYWORD_NOEXCEPT
static ValueType128 convertToDecimal128(const ValueType32 &input)
Definition bdldfp_decimalimputil.h:2890
static ValueType32 scaleB(ValueType32 value, int exponent)
Definition bdldfp_decimalimputil.h:3045
static ValueType32 signalingNaN32() BSLS_KEYWORD_NOEXCEPT
static ValueType64 epsilon64() BSLS_KEYWORD_NOEXCEPT
static ValueType32 pow(ValueType32 base, ValueType32 exp)
Definition bdldfp_decimalimputil.h:2060
static ValueType64 roundError64() BSLS_KEYWORD_NOEXCEPT
static ValueType64 parse64(const char *input)
Definition bdldfp_decimalimputil.h:3101
static ValueType128 max128() BSLS_KEYWORD_NOEXCEPT
static ValueType32 binaryToDecimal32(float value)
Definition bdldfp_decimalimputil.h:2906
static int format(char *buffer, int length, ValueType64 value, const DecimalFormatConfig &cfg)
static int decompose(int *sign, Uint128 *significand, int *exponent, ValueType128 value)
static long long int llrint(ValueType32 x)
Definition bdldfp_decimalimputil.h:1918
static ValueType64 infinity64() BSLS_KEYWORD_NOEXCEPT
static ValueType128 infinity128() BSLS_KEYWORD_NOEXCEPT
static ValueType32 parse32(const char *input)
Definition bdldfp_decimalimputil.h:3094
static bool notEqual(ValueType32 lhs, ValueType32 rhs)
Definition bdldfp_decimalimputil.h:2836
static ValueType32 floor(ValueType32 x)
Definition bdldfp_decimalimputil.h:2154
static ValueType32 copySign(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:2393
static ValueType32 convertDPDtoBID(DecimalStorage::Type32 dpd)
Definition bdldfp_decimalimputil.h:3140
static bool less(ValueType32 lhs, ValueType32 rhs)
Definition bdldfp_decimalimputil.h:2706
Imp::ValueType64 ValueType64
Definition bdldfp_decimalimputil.h:250
static ValueType32 round(ValueType32 x)
Definition bdldfp_decimalimputil.h:2190
static ValueType32 uint32ToDecimal32(unsigned int value)
Definition bdldfp_decimalimputil.h:1550
static bool greater(ValueType32 lhs, ValueType32 rhs)
Definition bdldfp_decimalimputil.h:2732
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 ValueType64 makeDecimalRaw64(long long int significand, int exponent)
static ValueType32 multiply(ValueType32 lhs, ValueType32 rhs)
Definition bdldfp_decimalimputil.h:1670
static ValueType32 convertFromBID(DecimalStorage::Type32 bid)
Definition bdldfp_decimalimputil.h:3183
static ValueType32 divide(ValueType32 lhs, ValueType32 rhs)
Definition bdldfp_decimalimputil.h:1698
static int decompose(int *sign, bsls::Types::Uint64 *significand, int *exponent, ValueType64 value)
static ValueType64 min64() BSLS_KEYWORD_NOEXCEPT
static ValueType32 epsilon32() BSLS_KEYWORD_NOEXCEPT
static ValueType32 roundError32() BSLS_KEYWORD_NOEXCEPT
static int decompose(int *sign, unsigned int *significand, int *exponent, ValueType32 value)
static ValueType64 normalize(ValueType64 original)
Imp::ValueType128 ValueType128
Definition bdldfp_decimalimputil.h:251
static ValueType32 makeDecimalRaw32(int significand, int exponent)
Definition bdldfp_decimalimputil.h:2950
static ValueType32 logB(ValueType32 x)
Definition bdldfp_decimalimputil.h:2510
static DecimalStorage::Type32 convertToBID(ValueType32 value)
Definition bdldfp_decimalimputil.h:3204
static int format(char *buffer, int length, ValueType32 value, const DecimalFormatConfig &cfg)
static ValueType64 makeDecimal64(int significand, int exponent)
static long int lround(ValueType32 x)
Definition bdldfp_decimalimputil.h:2226
static ValueType32 convertToDecimal32(const ValueType64 &input)
Definition bdldfp_decimalimputil.h:2862
static ValueType128 parse128(const char *input)
Definition bdldfp_decimalimputil.h:3108
static ValueType128 epsilon128() BSLS_KEYWORD_NOEXCEPT
static ValueType64 int64ToDecimal64(long long int value)
Definition bdldfp_decimalimputil.h:1579
static ValueType32 denormMin32() BSLS_KEYWORD_NOEXCEPT
static ValueType64 binaryToDecimal64(float value)
Definition bdldfp_decimalimputil.h:2920
static ValueType32 quantize(ValueType32 value, ValueType32 exponent)
Definition bdldfp_decimalimputil.h:1721
static int classify(ValueType64 x)
static ValueType32 subtract(ValueType32 lhs, ValueType32 rhs)
Definition bdldfp_decimalimputil.h:1644
static ValueType128 uint32ToDecimal128(unsigned int value)
Definition bdldfp_decimalimputil.h:1564
static ValueType64 quietNaN64() BSLS_KEYWORD_NOEXCEPT
static ValueType32 sqrt(ValueType32 x)
Definition bdldfp_decimalimputil.h:2357
static ValueType64 round(ValueType64 x, unsigned int precision)
static int quantizeEqual(ValueType32 *x, ValueType32 y, int exponent)
Definition bdldfp_decimalimputil.h:1805
static ValueType128 quietNaN128() BSLS_KEYWORD_NOEXCEPT
static ValueType128 signalingNaN128() BSLS_KEYWORD_NOEXCEPT
static bool equal(ValueType32 lhs, ValueType32 rhs)
Definition bdldfp_decimalimputil.h:2810
static ValueType32 uint64ToDecimal32(unsigned long long int value)
Definition bdldfp_decimalimputil.h:1594
static ValueType64 makeDecimalRaw64(unsigned long long int significand, int exponent)
static int classify(ValueType32 x)
static ValueType128 binaryToDecimal128(float value)
Definition bdldfp_decimalimputil.h:2934
static ValueType64 uint32ToDecimal64(unsigned int value)
Definition bdldfp_decimalimputil.h:1557
static ValueType128 round(ValueType128 x, unsigned int precision)
Examples: round(3.14159, 3) ==> 3.142.
static ValueType32 round(ValueType32 x, unsigned int precision)
static ValueType32 nexttoward(ValueType32 from, ValueType128 to)
Definition bdldfp_decimalimputil.h:2006
static int classify(ValueType128 x)
static ValueType32 quietNaN32() BSLS_KEYWORD_NOEXCEPT
static ValueType64 makeInfinity64(bool isNegative=false)
static ValueType32 int64ToDecimal32(long long int value)
Definition bdldfp_decimalimputil.h:1572
static ValueType32 nextafter(ValueType32 from, ValueType32 to)
Definition bdldfp_decimalimputil.h:1952
static ValueType32 exp(ValueType32 x)
Definition bdldfp_decimalimputil.h:2420
static ValueType64 int32ToDecimal64(int value)
Definition bdldfp_decimalimputil.h:1536
static ValueType128 normalize(ValueType128 original)
static ValueType32 negate(ValueType32 value)
Definition bdldfp_decimalimputil.h:2681
static ValueType128 makeDecimalRaw128(long long int significand, int exponent)
static ValueType64 makeDecimal64(unsigned int significand, int exponent)
@ k_STATUS_UNDERFLOW
Definition bdldfp_decimalimputil.h:257
@ k_STATUS_INEXACT
Definition bdldfp_decimalimputil.h:256
@ k_STATUS_OVERFLOW
Definition bdldfp_decimalimputil.h:258
static bool greaterEqual(ValueType32 lhs, ValueType32 rhs)
Definition bdldfp_decimalimputil.h:2784
static ValueType32 infinity32() BSLS_KEYWORD_NOEXCEPT
static ValueType32 int32ToDecimal32(int value)
Definition bdldfp_decimalimputil.h:1530
static long int lrint(ValueType32 x)
Definition bdldfp_decimalimputil.h:1885
static ValueType32 max32() BSLS_KEYWORD_NOEXCEPT
static ValueType32 add(ValueType32 lhs, ValueType32 rhs)
Definition bdldfp_decimalimputil.h:1619
static ValueType64 uint64ToDecimal64(unsigned long long int value)
Definition bdldfp_decimalimputil.h:1601
static ValueType128 min128() BSLS_KEYWORD_NOEXCEPT
static DecimalStorage::Type32 convertBIDtoDPD(ValueType32 value)
Definition bdldfp_decimalimputil.h:3161
static ValueType128 uint64ToDecimal128(unsigned long long int value)
Definition bdldfp_decimalimputil.h:1608
static int format(char *buffer, int length, ValueType128 value, const DecimalFormatConfig &cfg)
static ValueType128 int64ToDecimal128(long long int value)
Definition bdldfp_decimalimputil.h:1586
Imp::ValueType32 ValueType32
Definition bdldfp_decimalimputil.h:249
static bool sameQuantum(ValueType32 x, ValueType32 y)
Definition bdldfp_decimalimputil.h:1864
static ValueType64 denormMin64() BSLS_KEYWORD_NOEXCEPT
static ValueType32 ceil(ValueType32 x)
Definition bdldfp_decimalimputil.h:2117
static ValueType64 makeDecimal64(unsigned long long int significand, int exponent)
static ValueType64 signalingNaN64() BSLS_KEYWORD_NOEXCEPT
Definition bdldfp_uint128.h:175
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
Definition bdldfp_decimal.h:712
BID_UINT128 Type128
Definition bdldfp_decimalstorage.h:84
BID_UINT64 Type64
Definition bdldfp_decimalstorage.h:83
BID_UINT32 Type32
Definition bdldfp_decimalstorage.h:82
unsigned long long Uint64
Definition bsls_types.h:137