(C++) ClnExample1
February 24, 2017 · View on GitHub
(C++) ClnExample1




CLN example 1 is a CLN example that compares the regular and CLN int in calculating a huge factorial.
Technical facts
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: ./CppClnExample1/CppClnExample1.pro
#Apfloat will generate errors with -Weffc++ include(../../ConsoleApplicationNoWeffcpp.pri) include(../../Libraries/Cln.pri) #include(../../Libraries/Boost.pri) include(../../Libraries/FParser.pri) SOURCES += main.cpp
./CppClnExample1/main.cpp
#include <iostream> #include <cln/cln.h> //From http://www.richelbilderbeek.nl/CppClnExample1.htm int main() { //Regular int int x = 1; //CLN int ::cln::cl_I y = 1; for (int i=1; i!=50; ++i) { x*=i; y*=i; std::cout << i << "! : " << x << '\t' << y << '\n'; } }