root/software/fixed/fixed_test.cc @ 835f4592
| 835f4592 | David Sorber | #include <cmath>
|
|
#include <cstdint>
|
|||
#include <iomanip>
|
|||
#include <iostream>
|
|||
#include "fixed.h"
|
|||
// g++ fixed_text.cc -o fixed_test
|
|||
int main(int argc, char** argv)
|
|||
{
|
|||
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 << "Integer decimal digits: " << fixed_64_64::integer_decimal_digits << std::endl;
|
|||
std::cout << "Fractional decimal digits: " << fixed_64_64::fractional_decimal_digits << std::endl;
|
|||
std::cout << "Max integer value: " << fixed_64_64::MAX_INTEGER_VALUE << std::endl;
|
|||
std::cout << "Max fractional value: " << fixed_64_64::MAX_FRACTIONAL_VALUE << std::endl;
|
|||
//~ double foo = std::pow(10, 18);
|
|||
//~ std::cout << "Foo: " << std::fixed << std::setprecision(0) << foo << std::endl;
|
|||
//~ std::cout << "Foo: " << std::fixed << std::setprecision(0) << (static_cast<uint64_t>(foo) - 1) << std::endl;
|
|||
return 0;
|
|||
}
|