From: Jorge C. <Jor...@av...> - 2014-02-19 16:22:56
|
Hi there! I was doing a little exploration of underflow errors -- mostly to explain the IEEE-754 standard to my students -- and noticed that in some cases, underflows are handled differently based on the underlying platform. For instance, found that 4e-324 (entered straight from the prompt) rounds down to 0.0 in a Mac, up to 4.94065… x 10^-324 in older Windows machines, and is converted to the fixed-point number 4.0d-324 in Linux and newer Windows machines. It's really the underlying Lisp that seems to make a difference, but my point is that I don't know that any one of these behaviors is preferable over the others. Would your plan be to force conversion to bigfloats in place of any of these choices? Somewhat ambivalent... Jorge Richard Fateman <fa...@be...<mailto:fa...@be...>> writes: What about underflow? It seems to me it would be distressing if x^2 overflows to bigfloat but the mathematically equal quantity computed as 1/(1/x)^2 is a divide-by-zero. Rupert Swarbrick <rsw...@gm...<mailto:rsw...@gm...>> writes: Hmm, good point. Although 1/(1/x) != x for floating x anyway: (%i46) block([a: 1/x], 1/a - x), x=0.123; (%o46) - 1.387778780781446e-17 (The nonsense with block() is to avoid the simplifier setting the expression to zero ahead of time.) Anyone got any ideas? Do we trap underflows at the moment? Rupert -- Dr. Jorge Alberto Calvo Associate Professor of Mathematics Department of Mathematics and Physics Ave Maria University Phone: (239) 280-1608 Email: jor...@av...<mailto:jor...@av...> Web: http://sites.google.com/site/jorgealbertocalvo |