[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Don't want floating point underflows



Kai Puolamaki <kai.puolamaki@helsinki.fi> wrote:

> CLISP considers floating point underflows to be errors.  However, I
> would like (exp -100) return 0, not "*** - floating point underflow". 
> Is there an easy fix for this?

Try this patch (untested) and rebuild clisp from source.
(exp -100) should then return 0.0.

begin 644 underflow.diff.gz
M'XL( .3@\BT  ^U=6W/;1I9^GOR*8ZG*(210 < [9"6CF&*B&5G6BO)D4S-3
M7)!LDHA @ 6 MF5'^TNW:E_F-^S3/.SIQAUH\ K*DF)4V22A[M.GS_G.I?LT
MB8.# W#LP7<]W;1<XARY']TCR];'?^IJ+KS1[D"109+46DM5*B"W6M5ORN5R
MNL>?WE@F_&5N M1!:JD51:U*7N.#Y$4_0[W6$NOU*K ;E!J[T9  WY>_ >C^
MQ_4-6#9HX-J:Z0R(.22FJQDPFIL#5[=,001W0L FSMQPP;V;$= =&.OOB0G]
M._:W]YJM:WV#(+F#]EGG]-W%3;ES\?84_W][_>;TYN (__+-(=Q@VZDVL"WX
MY?SFY[?O_%;GES^5K]Z>7]Z4WUVVSZ[QWB\JM@8H?=#=B35WRR/#TES=')=G
MEFZZY3GR:..]#_!Y9-G3^P,!FY./9#!'$3&.Z&U'!-H?B&U;M@/6R&,^;TC0
MS8G>UUTR/$)J'7]$8"."-2.V1J7A($W# $<W4$K&'8K%G=LF?"(X*=UT7*(-
MZ4B./C8UPT "2$LS/1Z6LD '1DG)RE&52JSLJXCID8* R<Y1C@QG%L'F=&:#
M7 =94N6Z*LM)V,1ZI&"C8.-6/FPJ=4FLU"L1;-B-AA+ !N"_2J]/NV=0:I^]
MN^F^_AF^#=Z<7?YT<=[%&\&;SO7IY>O3\RY\&[P30/QSWQK>"4B)_CLN%WNA
M'$NZ69YI@UMM3& /V;C:HR ID8\SRW;AVV7($M(DNK]V;\[>>$2&9.3!>"D^
M2R_I-,&;ZR&3VL79#91*2$Y5#\XO?S[_\3S?# [@1O#Z46NX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