[GiNaC-list] Internal error: statement in file ./real/conv/cl_R_to_double.cc, line 55 has been reached!!

Pedro Cruz jpedro at mat.ua.pt
Fri Dec 8 13:14:42 CET 2006


Hi,

--------------------
this output
--------------------

Pi=3.1415926535897932385
Internal error: statement in file ./real/conv/cl_R_to_double.cc, line 55
has been reached!!
Please send the authors of the program a description how you produced
this error!

--------------------
has been produced by 
--------------------


#include <iostream>
#include <sstream>
#include <stdexcept>
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;


int main()
{
  cout << "Pi=" << Pi.evalf() << endl;

  if (is_a<constant>(Pi)) {
    double f = ex_to<numeric>(Pi).to_double();
    cout << f << endl;
  }

  return 0;
}

---------------------------------------------
on debian (etch testing) with libginac1.3c2a.
---------------------------------------------

It was a first example i tried to do
in order to understand ginac/cln concepts:
<ex>
<constant> and
<numeric>.


How to convert from Pi to C++ double type in one C++ line ?

Thanks,

Pedro Cruz




More information about the GiNaC-list mailing list