crash in cln when converting numeric to double
Hi, below you'll find a small test program that crashes for me. -------------------------------------------- #include <ginac/ginac.h> #include <iostream> int main(int argc, char* argv[]) { GiNaC::parser p; GiNaC::ex e = p("941480149401/1250000000000000*2^(5/91)"); GiNaC::numeric n = GiNaC::ex_to<GiNaC::numeric>(e); double x = n.to_double(); //throws the exception below return 0; } /* terminate called after throwing an instance of 'cln::notreached_exception' what(): Internal error: statement in file real/conv/cl_R_to_double.cc, line 55 has been reached!! */ -------------------------------------------- g++ test.cpp -o test -lginac -------------------------------------------- ./test -------------------------------------------- Looks like the real problem lays in cln, but I'm not sure how to reproduce it there. I tested on three systems all with cln 1.3.1. Ubutnu 10.4 (64bit) with ginac 1.5.5, gcc 4.4 Gentoo (64bit) with ginac 1.5.8, gcc-4.5 Gentoo (32bit) with ginac 1.5.5, gcc-4.4 Let me know if you need something else. Sebastian -- GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
Hi! On 11/02/2010 08:12 AM, Sebastian Luther wrote:
below you'll find a small test program that crashes for me.
-------------------------------------------- #include<ginac/ginac.h> #include<iostream>
int main(int argc, char* argv[]) { GiNaC::parser p; GiNaC::ex e = p("941480149401/1250000000000000*2^(5/91)"); GiNaC::numeric n = GiNaC::ex_to<GiNaC::numeric>(e); double x = n.to_double(); //throws the exception below return 0; }
Since e is a product (of a rational number and a power of two) it must be converted to a number using evalf() before trying to assign it to a simple numeric object.
Looks like the real problem lays in cln, but I'm not sure how to reproduce it there.
It has nothing to do with CLN. Best wishes -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
participants (2)
-
Richard B. Kreckel
-
Sebastian Luther