Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok I got the answer from the author I post here: support for IEEE floating-point infinities is platform-dependent. The following Lisps work, at least on this system (MacOSX):</p> <p><strong>SBCL</strong></p> <pre><code>R&gt; (r "/" 1 0) .SB-EXT:DOUBLE-FLOAT-POSITIVE-INFINITY R&gt; (r "log" 0) .SB-EXT:DOUBLE-FLOAT-NEGATIVE-INFINITY </code></pre> <p><strong>Allegro CL</strong></p> <pre><code>R&gt; (r "/" 1 0) .EXCL:*INFINITY-DOUBLE* R&gt; (r "log" 0) .EXCL:*NEGATIVE-INFINITY-DOUBLE* </code></pre> <p><strong>LispWorks</strong></p> <pre><code>R&gt; (r "/" 1 0) +1D++0 #| +1D++0 is double-float plus-infinity R&gt; (r "log" 0) -1D++0 #| -1D++0 is double-float minus-infinity </code></pre> <p><strong>CMUCL</strong> doesn't (X86:SIGFPE-HANDLER, no exceptions enabled), but I think this can be fixed (<a href="http://common-lisp.net/project/cmucl/doc/cmu-user/extensions.html#float-traps" rel="nofollow noreferrer">http://common-lisp.net/project/cmucl/doc/cmu-user/extensions.html#float-traps</a>). </p> <p><strong>ECL</strong> is the last one that I tried, and it's apparently the one you use (I got the same <code>FLOATING-POINT-OVERFLOW</code> exception). It seems that it also allows to disable overflow checks using <code>SI:TRAP-FPE</code>, this might be what you need (the following example is taken from <a href="http://www.lispforum.com/viewtopic.php?f=2&amp;t=386" rel="nofollow noreferrer">http://www.lispforum.com/viewtopic.php?f=2&amp;t=386</a>):</p> <pre><code>(let* ((bits (si::trap-fpe 'last nil))) (prog1 (/ 1.0 0.0) (si::trap-fpe bits t))) .SI:SINGLE-FLOAT-POSITIVE-INFINITY </code></pre> <p><strong>Also this works in general</strong>:</p> <pre><code>(handler-case (r "/" 2 0) (floating-point-overflow () nil)) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload