text
stringlengths 0
2.2M
|
---|
}
|
if (verbose) cout << "\nTesting 'bsls::Types::Uint64'." << endl;
|
{
|
static const RoundTripTestData<bsls::Types::Uint64> DATA[] =
|
{
|
//line input
|
//---- -----
|
{ L_, 0ULL },
|
{ L_, 1ULL },
|
{ L_, 18446744073709551614ULL },
|
{ L_, 18446744073709551615ULL },
|
};
|
printDefaultRoundTripTester(DATA);
|
}
|
if (verbose) cout << "\nTesting 'float'." << endl;
|
{
|
typedef bsl::numeric_limits<float> NumLimits;
|
const float neg0 = copysignf(0.0f, -1.0f);
|
static const RoundTripTestData<float> DATA[] =
|
{
|
//line input
|
//---- --------------------
|
{ L_, neg0 },
|
{ L_, -1.0f },
|
{ L_, -0.1f },
|
{ L_, -1234567.f },
|
{ L_, -0.1234567f },
|
{ L_, -1.234567e35f },
|
{ L_, -1.234567e-35f },
|
{ L_, 0.0f },
|
{ L_, 1.0f },
|
{ L_, 0.1f },
|
{ L_, 1234567.f },
|
{ L_, 0.1234567f },
|
{ L_, 1.234567e35f },
|
{ L_, 1.234567e-35f },
|
// Values from 'balxml_encoder.t.cpp' 'runTestCase17'
|
{ L_, 1.1920928e-07f },
|
{ L_, 2.3841856e-07f },
|
{ L_, 1.5258789e-05f },
|
{ L_, 2.4414062e-04f },
|
{ L_, 3.90625e-03f },
|
{ L_, 6.25e-02f },
|
{ L_, 5e-1f },
|
{ L_, 1.0f },
|
{ L_, 1024.0f },
|
{ L_, 16777216.0f },
|
{ L_, 137438953472.0f },
|
{ L_, 1125899906842624.0f },
|
{ L_, 18014398509481984.0f },
|
// {DRQS 165162213} regression, 2^24 loses precision as float
|
{ L_, 1.0f * 0xFFFFFF },
|
// Full Mantissa Integers
|
{ L_, 1.0f * 0xFFFFFF // this is also
|
* (1ull << 63) // 'NumLimits::max()'
|
* (1ull << 41) },
|
// Boundary Values
|
{ L_, NumLimits::min() },
|
{ L_, NumLimits::max() },
|
{ L_, -NumLimits::min() },
|
{ L_, -NumLimits::max() },
|
};
|
printDefaultRoundTripTester(DATA);
|
}
|
if (verbose) cout << "\nTesting 'double'." << endl;
|
{
|
typedef bsl::numeric_limits<double> NumLimits;
|
const double neg0 = copysign(0.0, -1.0);
|
static const RoundTripTestData<double> DATA[] =
|
{
|
//line input
|
//---- ------------------------------------
|
{ L_, neg0 },
|
{ L_, -1.0 },
|
{ L_, -0.1 },
|
{ L_, -0.123456789012345 },
|
{ L_, -1.23456789012345e+105 },
|
{ L_, -1.23456789012345e-105 },
|
{ L_, 0.0 },
|
{ L_, 0.1 },
|
{ L_, 1.0 },
|
{ L_, 1.23456789012345e105 },
|
{ L_, 123.4567 },
|
// Values from 'balxml_encoder.t.cpp' 'runTestCase17'
|
{ L_, 1.0 },
|
{ L_, 1024.0 },
|
{ L_, 16777216.0 },
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.