Dear all,

I got an odd behaviour using _fast_float in find_maximum_on_interval,
where a complex number was output as 'nan', which is not the same as
NaN or 'nan'. How can I test for such occurences in order to exclude
them?

Thanks for your help!

Stan

----------------------------------------------------------------------
| SAGE Version 3.1.1, Release Date: 2008-08-17                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------

sage: var('av')
av
sage: bv1=(10*sqrt(70.5600000000000*(av^4 - 2*av^3 + av^2) +
....: 207.360000000000*(-4*av^4 + 8*av^3 - 4*av^2) +
....: 365*(51.8400000000000*(4*av^3 - 4*av) + 17.6400000000000*(2*av -
....: 2*av^2)) + 133225*(4.41000000000000 - 51.8400000000000*av)) +
....: 84.0000000000000*(av - av^2) + 7665.00000000000)/
(720.000000000000*(2 -
....: 2*av) + 131400.000000000)
sage: soln=find_maximum_on_interval(bv1._fast_float_('av'),0,1);soln
(nan, 0.38196601125)
sage: type(soln[0])
<type 'float'>
sage: soln[0]==nan
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call
last)

/Users/sschym/<ipython console> in <module>()

NameError: name 'nan' is not defined
sage: soln[0]=='nan'
False
sage: soln[0]>0.
True
sage: soln[0]<1.
False
sage: soln1=find_maximum_on_interval(bv1,0,1);soln1
(7.55915212607560e-6*(14395.05425073996*I + 7684.829710109982),
0.38196601125)
sage: soln[0]==soln1[0]
7.55915212607560e-6*(14395.05425073996*I + 7684.829710109982) == nan
sage: soln[0]==NaN
NaN == nan
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to