|
From: Richard F. <fa...@be...> - 2016-01-26 16:32:19
|
On 1/26/2016 1:44 AM, David Scherfgen wrote: > Hello, > > I'm getting very weird and inconsistent behavior when doing > float(exp(10000)) vs. float(exp(10000/3)) and float(exp(10000.0)). > > The first one works - the result is promoted to bigfloat. This is a hack, and I suppose previously it overflowed. float() used to convert to double-float machine precision. Someone changed it to upgrade to bigfloat, i.e. make it the same as bfloat() when needed. > The second one gives me floating point infinity, even though the exp > argument is actually smaller! If you really want the number, try bfloat(exp(10000/3)) which works. Apparently the hack in the first example wasn't complete enough. > The third one gives an error. I think this one fails because exp(10000.0) overflows before float() sees it. Not a bug? > > I guess this is not intended, right? > > Maxima branch_5_37_base_407_g2af0c38 http://maxima.sourceforge.net > using Lisp GNU Common Lisp (GCL) GCL 2.6.12 > Distributed under the GNU Public License. See the file COPYING. > Dedicated to the memory of William Schelter. > The function bug_report() provides bug reporting information. > > (%i1) float(exp(10000)); > (%o1) 8.806818225658306b4342 > > (%i2) float(exp(10000/3)); > (%o2) i.nfE+0 > > (%i3) float(exp(10000.0)); > float: floating point overflow converting 8.806818225662922b4342 > -- an error. To debug this try: debugmode(true); > > Best regards, > David Scherfgen > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss |