Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
Close
From: Alexey Beshenov <al@be...>  20081216 00:08:05

clisp 2.44.1 gives (on my machine) leastpositivesinglefloat => 1.1754944E38 mostpositivesinglefloat => 3.4028235E38 (/ 1.0 mostpositivesinglefloat) => floating point underflow while sbcl 1.0.18 gives leastpositivesinglefloat => 1.4012985e45 mostpositivesinglefloat => 3.4028235e38 (/ 1.0 mostpositivesinglefloat) => 2.938736e39 Which is right? Actually, 1.1754944E38 is a leastpositivenormalizedsinglefloat.  Prickle Prickle, Aftermath 57 YOLD 3174 Alexey Beshenov http://beshenov.ru/ 
From: Sam Steingold <sds@gn...>  20081216 04:39:46

> * Alexey Beshenov <ny@...> [20081216 02:41:12 +0300]: > > clisp 2.44.1 gives (on my machine) > > leastpositivesinglefloat => 1.1754944E38 > mostpositivesinglefloat => 3.4028235E38 > (/ 1.0 mostpositivesinglefloat) => floating point underflow > > while sbcl 1.0.18 gives > > leastpositivesinglefloat => 1.4012985e45 > mostpositivesinglefloat => 3.4028235e38 > (/ 1.0 mostpositivesinglefloat) => 2.938736e39 > > Which is right? > > Actually, 1.1754944E38 is a leastpositivenormalizedsinglefloat. CLISP does not support gradual underflow.  Sam Steingold (http://sds.podval.org/) on Ubuntu 8.10 (intrepid) http://jihadwatch.org http://israelunderattack.slide.com http://dhimmi.com http://openvotingconsortium.org http://truepeace.org http://camera.org Linux: Telling Microsoft where to go since 1991. 
From: Alexey Beshenov <al@be...>  20081216 07:39:02

On Tuesday 16 December 2008 07:40:35 Sam Steingold wrote: > > clisp 2.44.1 gives (on my machine) > > > > leastpositivesinglefloat => 1.1754944E38 > > mostpositivesinglefloat => 3.4028235E38 > > (/ 1.0 mostpositivesinglefloat) => floating point underflow > > > > while sbcl 1.0.18 gives > > > > leastpositivesinglefloat => 1.4012985e45 > > mostpositivesinglefloat => 3.4028235e38 > > (/ 1.0 mostpositivesinglefloat) => 2.938736e39 > > > > Which is right? > > > > Actually, 1.1754944E38 is a > > leastpositivenormalizedsinglefloat. > > CLISP does not support gradual underflow. For what reason? As for (/ 1.0 mostpositivesinglefloat) operation, I found it in a Fortran routine from netlib.org, so it was quite confusing for me that it could be criminal for some of the popular implementations...  Setting Orange, Aftermath 58 YOLD 3174 Alexey Beshenov http://beshenov.ru/ 
From: Christopher Browne <cbbrowne@gm...>  20081216 05:40:52

On Mon, Dec 15, 2008 at 6:41 PM, Alexey Beshenov <al@...> wrote: > clisp 2.44.1 gives (on my machine) > > leastpositivesinglefloat => 1.1754944E38 > mostpositivesinglefloat => 3.4028235E38 > (/ 1.0 mostpositivesinglefloat) => floating point underflow > > while sbcl 1.0.18 gives > > leastpositivesinglefloat => 1.4012985e45 > mostpositivesinglefloat => 3.4028235e38 > (/ 1.0 mostpositivesinglefloat) => 2.938736e39 > > Which is right? I wouldn't necessarily assume that any of these are wrong. These values each indicate the limits of the respective implementations' floating point values, and there are evidently nonlinear behaviours at the edges, which would seem supported by the fact that the "least positive" and "most positive" values are not reciprocals of one another.  http://linuxfinances.info/info/linuxdistributions.html Chevy Chase  "Parrots make great pets. They have more personality than goldfish." 
From: Sam Steingold <sds@gn...>  20081216 14:29:06

Alexey Beshenov wrote: > On Tuesday 16 December 2008 07:40:35 Sam Steingold wrote: >>> clisp 2.44.1 gives (on my machine) >>> >>> leastpositivesinglefloat => 1.1754944E38 >>> mostpositivesinglefloat => 3.4028235E38 >>> (/ 1.0 mostpositivesinglefloat) => floating point underflow >>> >>> while sbcl 1.0.18 gives >>> >>> leastpositivesinglefloat => 1.4012985e45 >>> mostpositivesinglefloat => 3.4028235e38 >>> (/ 1.0 mostpositivesinglefloat) => 2.938736e39 >>> >>> Which is right? >>> >>> Actually, 1.1754944E38 is a >>> leastpositivenormalizedsinglefloat. >> CLISP does not support gradual underflow. > > For what reason? http://clisp.cons.org/impnotes/numconcepts.html#floatcomp The single and double float formats are those of the IEEE 754 “Standard for Binary FloatingPoint Arithmetic”, except that CLISP does not support features like ±0, ±inf, NaN, gradual underflow, etc. Common Lisp does not make use of these features, so, to reduce portability problems, CLISP by design returns the same floating point results on all platforms (CLISP has a floatingpoint emulation built in for platforms that do not support IEEE 754). Note that * When you got a NaN in your program, your program is broken, so you will spend time determining where the NaN came from. It is better to SIGNAL an ERROR in this case. * When you got unnormalized floats in your program, your results will have a greatly reduced accuracy anyway. Since CLISP has the means to cope with this  LONGFLOATs of variable precision  it does not need unnormalized floats. This is why *FEATURES* does not contain the :IEEEFLOATINGPOINT keyword. > As for (/ 1.0 mostpositivesinglefloat) operation, I found it in a how is it better than leastpositivesinglefloat? also, why do you want to use this number? I bet you are more interested in singlefloatepsilon. > Fortran routine from netlib.org, so it was quite confusing for me that Lisp is not Fortran. :) > it could be criminal for some of the popular implementations... it's not that bad. it's illegal, but not criminal :) 
From: Alexey Beshenov <al@be...>  20081216 17:02:03

On Tuesday 16 December 2008 17:28:54 Sam Steingold wrote: >> Fortran routine from netlib.org, so it was quite confusing... > Lisp is not Fortran. :) I just expected the IEEE 754 FP from CLISP. >> For what reason? > > http://clisp.cons.org/impnotes/numconcepts.html#floatcomp > ... > This is why *FEATURES* does not contain the :IEEEFLOATINGPOINT > keyword. Thank you for the explanation. >> As for (/ 1.0 mostpositivesinglefloat) operation, I found it >> in a > > how is it better than leastpositivesinglefloat? > also, why do you want to use this number? > I bet you are more interested in singlefloatepsilon. The routine I've tried to translate to Lisp does require the machine epsilon as well as the min positive number. As for (/ 1.0 mostpositivesinglefloat), it looks odd and I agree that it (probably) could be replaced by the leastpositivesinglefloat. Thank you.  Setting Orange, Aftermath 58 YOLD 3174 Alexey Beshenov http://beshenov.ru/ 