]> www.ginac.de Git - ginac.git/commitdiff
fsolve: check if evalf() return value is actually a number.
authorAlexei Sheplyakov <alexei.sheplyakov@gmail.com>
Wed, 18 Aug 2010 21:07:13 +0000 (00:07 +0300)
committerJens Vollinga <jensv@nikhef.nl>
Sat, 21 Aug 2010 17:57:21 +0000 (19:57 +0200)
Fixes the segfault triggered by

fsolve((1/(sqrt(2*Pi)))*integral(t,0,x,exp(-1/2*t^2))==0.5,x,0,100)

In general, ex_to is unsafe, and should be used only after proper checks.
evalf() may return non-numeric expression for various reasons (bad
convergence, floating point over- or underflow, out of memory, etc).
So let's add missing checks.

Thanks to Ernst Moritz Hahn for a bug report.


No differences found