Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) ClnExample1

 

CLNSTLQt CreatorLubuntu

 

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)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

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';
  }
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml