text
stringlengths
0
2.2M
{ L_, 137438953472.0 },
{ L_, 1125899906842624.0 },
{ L_, 18014398509481984.0 },
{ L_, 1.1920928955078125e-07 },
{ L_, 2.384185791015625e-07 },
{ L_, 1.52587890625e-05 },
{ L_, 2.44140625e-04 },
{ L_, 3.90625e-03 },
{ L_, 6.25e-02 },
{ L_, 5e-1 },
// Small Integers
{ L_, 123456789012345. },
{ L_, 1234567890123456. },
// Full Mantissa Integers
{ L_, 1.0 * 0x1FFFFFFFFFFFFFull },
{ L_, 1.0 * 0x1FFFFFFFFFFFFFull // This number is also
* (1ull << 63) * (1ull << 63) // 'NumLimits::max()'
* (1ull << 63) * (1ull << 63)
* (1ull << 63) * (1ull << 63)
* (1ull << 63) * (1ull << 63)
* (1ull << 63) * (1ull << 63)
* (1ull << 63) * (1ull << 63)
* (1ull << 63) * (1ull << 63)
* (1ull << 63) * (1ull << 26) },
// Boundary Values
{ L_, NumLimits::min() },
{ L_, NumLimits::max() },
{ L_, -NumLimits::min() },
{ L_, -NumLimits::max() },
};
printDefaultRoundTripTester(DATA);
}
if (verbose) cout << "\nTesting 'Decimal64'." << endl;
{
typedef bdldfp::Decimal64 Type;
typedef bsl::numeric_limits<Type> Limits;
#define DFP(X) BDLDFP_DECIMAL_DD(X)
const struct TestData {
int d_line;
Type d_input;
char d_style;
int d_precision;
bool d_weird;
} DATA[] = {
//--------------------------------------------------------
// LN VALUE STYLE PRECISION WEIRD
//--------------------------------------------------------
{ L_, DFP(0.0), 'N', 0, 0 },
{ L_, DFP(15.13), 'N', 0, 0 },
{ L_, DFP(-9.876543210987654e307), 'N', 0, 0 },
{ L_, DFP(0.001), 'N', 0, 0 },
{ L_, DFP(0.01), 'N', 0, 0 },
{ L_, DFP(0.1), 'N', 0, 0 },
{ L_, DFP(1.), 'N', 0, 0 },
{ L_, DFP(1.0), 'N', 0, 0 },
{ L_, DFP(1.00), 'N', 0, 0 },
{ L_, DFP(1.000), 'N', 0, 0 },
{ L_, Limits::max(), 'N', 0, 0 },
{ L_, -Limits::max(), 'N', 0, 0 },
{ L_, Limits::min(), 'N', 0, 0 },
{ L_, -Limits::min(), 'N', 0, 0 },
{ L_, Limits::infinity(), 'N', 0, 1 },
{ L_, -Limits::infinity(), 'N', 0, 1 },
{ L_, Limits::signaling_NaN(), 'N', 0, 1 },
{ L_, Limits::quiet_NaN(), 'N', 0, 1 },
{ L_, DFP(0.0), 'F', 2, 0 },
{ L_, DFP(15.13), 'F', 2, 0 },
{ L_, DFP(-9876543210987654.0), 'F', 0, 0 },
{ L_, DFP(0.001), 'F', 3, 0 },
{ L_, DFP(0.001), 'F', 4, 0 },
{ L_, DFP(0.01), 'F', 2, 0 },
{ L_, DFP(0.01), 'F', 3, 0 },
{ L_, DFP(0.1), 'F', 1, 0 },
{ L_, DFP(0.1), 'F', 2, 0 },
{ L_, DFP(1.), 'F', 0, 0 },
{ L_, DFP(1.), 'F', 0, 0 },
{ L_, DFP(1.), 'F', 1, 0 },
{ L_, DFP(1.0), 'F', 0, 0 },
{ L_, DFP(1.0), 'F', 1, 0 },
{ L_, DFP(1.0), 'F', 2, 0 },
{ L_, DFP(1.00), 'F', 0, 0 },
{ L_, DFP(1.00), 'F', 1, 0 },
{ L_, DFP(1.00), 'F', 2, 0 },
{ L_, DFP(1.00), 'F', 3, 0 },
{ L_, DFP(1.000), 'F', 0, 0 },
{ L_, DFP(1.000), 'F', 1, 0 },
{ L_, DFP(1.000), 'F', 2, 0 },
{ L_, DFP(1.000), 'F', 3, 0 },
{ L_, DFP(1.000), 'F', 4, 0 },
{ L_, Limits::min(), 'F', 383, 0 },
{ L_, -Limits::min(), 'F', 383, 0 },
{ L_, Limits::infinity(), 'F', 0, 1 },