Apfloat example 1 is an apfloat example.
Operating system(s) or programming environment(s)
Lubuntu 15.04 (vivid)
Qt Creator 3.1.1
- G++ 4.9.2
Libraries used:
STL: GNU ISO C++ Library, version 4.9.2
Qt project file: ./CppApfloatExample1/CppApfloatExample1.pro
include(../../ConsoleApplication.pri) include(../../Libraries/Apfloat.pri) include(../../Libraries/Boost.pri) SOURCES += main.cpp
#include <iostream> #include "apfloat.h" using namespace std; int main() { double x = 1.0; apfloat y = 1.0; for (int i=0; i!=20; ++i) { x /= 1.0e50; y /= 1.0e50; std::cout << x << " " << y << '\n'; } } /* Screen output 1e-050 0.000009999999999999998550000e-45 1e-100 0.099999999999999971e-99 1e-150 0.000000999999999999999565000e-144 1e-200 0.009999999999999994200000000e-198 1e-250 0.000000099999999999999927500e-243 1e-300 0.000999999999999999130000000e-297 0 0.000000009999999999999989850e-342 0 0.000099999999999999884000000e-396 0 0.999999999999998695e-450 0 0.000009999999999999985500000e-495 0 0.099999999999999840500000000e-549 0 0.000000999999999999998260000e-594 0 0.009999999999999981150000000e-648 0 0.000000099999999999999797000e-693 0 0.000999999999999997825000000e-747 0 0.000000009999999999999976800e-792 0 0.000099999999999999753500000e-846 0 0.999999999999997390e-900 0 0.000009999999999999972450000e-945 0 0.099999999999999710e-999 Press <RETURN> to close this window... */