<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Dear all
<div class=""><br class="">
</div>
<div class="">I am fooling around (again!) with the spec of a math library that I want the students to work on as a project. Language is Common Lisp.</div>
<div class=""><br class="">
</div>
<div class="">Essentially the library is an extended generic math library built on the basis of the many ones floating around.</div>
<div class=""><br class="">
</div>
<div class="">Now. Here comes IEEE. And “infinity"</div>
<div class=""><br class="">
</div>
<div class="">Among many implementations there is more or less a consensus about how to “represent” IEEE infinities in CL.</div>
<div class=""><br class="">
</div>
<div class="">E.g.</div>
<div class=""><br class="">
</div>
<div class=""><font face="Andale Mono" class="">LW > <font color="#0433ff" class="">
math:long-float-positive-infinity</font><br class="">
+1D++0 #| +1D++0 is double-float plus-infinity |#</font></div>
<div class=""><font face="Andale Mono" class=""><br class="">
</font></div>
<div class=""><font face="Andale Mono" class="">CCL ? <font color="#0433ff" class="">
math:long-float-positive-infinity</font><br class="">
1D++0</font></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">and so on.</div>
<div class=""><br class="">
</div>
<div class="">NaN is not as clearly defined.</div>
<div class=""><br class="">
</div>
<div class=""><font face="Andale Mono" class="">LW 45 > <font color="#0433ff" class="">
math:nan</font><br class="">
1D+-0 #| 1D+-0 is double-float not-a-number |#</font></div>
<div class=""><font face="Andale Mono" class=""><br class="">
</font></div>
<div class=""><font face="Andale Mono" class="">CCL ? <font color="#0433ff" class="">
math:nan</font><br class="">
1D+-0 #| not-a-number |#</font></div>
<div class=""><br class="">
</div>
<div class="">But to get a NaN in SBCL/CMUCL requires a trick. I use</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span><font face="Andale Mono" class="">(sb-kernel:make-double-float -524288 0))</font> ; Courtesy of Raymond Toy.</div>
<div class=""><br class="">
</div>
<div class="">In any case… There are two issues that I would like to brainstorm a bit.</div>
<div class=""><br class="">
</div>
<div class="">The first one pertains rounding modes. Give the current state of affairs, it does not seem possible to access them in all the CL implementations. CMUCL/SBCL give you the necessary hooks, but LW doesn’t. Let’s skip this.</div>
<div class=""><br class="">
</div>
<div class="">The second is just a simple question.</div>
<div class=""><br class="">
</div>
<div class="">Given that we *do* have (with some acrobatics) access to IEEE infinities, would you add
<b class="">symbolic</b> constants to such library like</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span><font face="Andale Mono" class="">(defconstant +posinf+ ‘+posinf+)</font></div>
<div class=""><br class="">
</div>
<div class="">or would you just rely on the IEEE infinities?</div>
<div class=""><br class="">
</div>
<div class="">Generic functions like</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span><font face="Andale Mono" class="">(defgeneric plus (x y) …)</font></div>
<div class=""><br class="">
</div>
<div class="">Will obviously be affected.</div>
<div class=""><br class="">
</div>
<div class="">I just want to get a feeling about the overall wisdom of this crowd.</div>
<div class=""><br class="">
</div>
<div class="">All the best</div>
<div class=""><br class="">
</div>
<div class="">Marco</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class=""><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; ">
<div class="">--</div>
<div class="">Marco Antoniotti</div>
<br class="Apple-interchange-newline">
</span></div>
<br class="">
</div>
</body>
</html>