[GiNaC-list] Problem: Floating point overflow

Richard B. Kreckel kreckel at ginac.de
Sat Mar 31 23:06:31 CEST 2007


Sheplyakov Alexei wrote:
> I used to think that GiNaC does not evaluate expressions numerically
> unless evalf() is called. Apparently this is not true. I think this
> is a bug which should be fixed.

Regarding .eval(), the idea is to evaluate numerically if and only if 
there is no exact value to be preserved. Integers and rationals are 
exact, floats not. Hence:
sin(3/2) -> sin(3/2)
sin(1.5) -> 0.9974949866040544309

Richard B. Kreckel

More information about the GiNaC-list mailing list