Revision 852d0468
Added by David Sorber over 4 years ago
| software/fixed/fixed_util.cc | ||
|---|---|---|
|
{
|
||
|
std::cout << "Fixed Type Test Util\n" << std::endl;
|
||
|
|
||
|
//-------------------------------------------------------------------------
|
||
|
fixed_64_64 foobar;
|
||
|
std::cout << "Type size: " << sizeof(fixed_64_64) << std::endl;
|
||
|
|
||
| ... | ... | |
|
std::cout << "Max fractional value: " << fixed_64_64::MAX_FRACTIONAL_VALUE << std::endl;
|
||
|
|
||
|
std::cout << std::endl;
|
||
|
std::cout << "Value: " << foobar << std::endl;
|
||
|
std::cout << "Value: " << foobar << "\n\n" << std::endl;
|
||
|
//-------------------------------------------------------------------------
|
||
|
#ifdef USE_INT128
|
||
|
|
||
|
fixed_128_128 barfoo;
|
||
|
std::cout << "Type size: " << sizeof(barfoo) << std::endl;
|
||
|
|
||
|
std::cout << "Integer decimal digits: " << fixed_128_128::integer_decimal_digits << std::endl;
|
||
|
std::cout << "Fractional decimal digits: " << fixed_128_128::fractional_decimal_digits << std::endl;
|
||
|
|
||
|
std::cout << "Max integer value: " << fixed_128_128::MAX_INTEGER_VALUE << std::endl;
|
||
|
|
||
|
std::cout << "Max fractional value: " << fixed_128_128::MAX_FRACTIONAL_VALUE << std::endl;
|
||
|
|
||
|
std::cout << std::endl;
|
||
|
std::cout << "Value: " << barfoo << "\n\n" << std::endl;
|
||
|
|
||
|
#endif
|
||
|
//-------------------------------------------------------------------------
|
||
|
|
||
|
fixed_64_64 quxbar(3, 1415926353);
|
||
|
std::cout << "Value: " << quxbar << std::endl;
|
||
Modify template to include parameters for strtoXXX functions. Also begin
integrating support for 128 bit integer types.