Re: +-Inf and NaN
Richard Fateman <[email protected]> Fri, 1 Mar 2024 11:50:47 -0800
| Newsgroups | gmane.comp.mathematics.maxima.general,gmane.lisp.gcl.devel |
|---|---|
| Message-ID | <CADB8Zm6chiOS64HKZNoDBeUXm0FFN+GisOqjUZ=dwgmybehAgw@mail.gmail.com> |
I realized that I'd wrestled with this many years ago, and found something..
I sent Camm a file with tentative solution outline used for Allegro CL. (I
can send to others on request...)
Here's the nub of it. It is relying on compiler optimization to break the
abstraction,
and it works to decode a NaN in (at least) SBCL as well.
(defun dfloat2bits(x &aux (ans (make-array 64 :element-type
'(unsigned-byte 1))))
(declare(optimize (speed 3)(safety 0)) ;; important
(type (simple-array (unsigned-byte 1)(64)) x)) ;; a lie, if x is a double
float.
(dotimes (i 64 ans)
(declare (fixnum i))
(setf (aref ans i) (aref x i))))
On Fri, Mar 1, 2024 at 10:54 AM Richard Fateman <[email protected]> wrote:
> In order to use NaN mantissas as payloads for other data,
> I think we need something to break the abstraction. Are these features
> available in any lisp?
>
<snip>
_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss