Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) cln::cl_I

 

cln::cl_I is the CLN data type for an near-infinite-sized int.

 

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

 

 

 

 

 

cln::cl_I code snippets

 

  1. CliToInt, convert cln::cl_I to int
  2. CliToStr, convert cln::cl_I to std::string
  3. IntToStrWithSep, add thousands seperators
  4. SafeIntToCli, convert int to cln::cl_I

 

 

 

 

 

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

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict