Lisp HUG Maillist Archive

reading big-endian float ?

I have some big endian 8 byte floating point numbers in a file I'm 
trying to read.  With a previous Lisp system I was using I just read 
those via a foreign function call to some C code that I had written to do it.


I'm guessing I could just use ldb on the mantissa and the exponent 
parts and then construct it, but before I go looking up how those are 
stored, exactly, I figured I should ask if there is a built in 
function in LispWorks for doing this.  Is there?

I tried apropos but didn't seem to find anything.

Or, does anyone have some code for this, or at least remember how the 
two parts are stored for a big endian double?

Chris


Re: reading big-endian float ?

On Sat, 31 Mar 2007 13:24:30 -0700, Chris Perkins <cperkins@medialab.com> wrote:

> I have some big endian 8 byte floating point numbers in a file I'm
> trying to read.  With a previous Lisp system I was using I just read
> those via a foreign function call to some C code that I had written
> to do it.
>
> I'm guessing I could just use ldb on the mantissa and the exponent
> parts and then construct it, but before I go looking up how those
> are stored, exactly, I figured I should ask if there is a built in
> function in LispWorks for doing this.  Is there?
>
> I tried apropos but didn't seem to find anything.
>
> Or, does anyone have some code for this, or at least remember how
> the two parts are stored for a big endian double?

Maybe you can use this one as a starting point:

  http://common-lisp.net/project/ieee-floats/

Cheers,
Edi.


Updated at: 2020-12-10 08:46 UTC