[Xorp-hackers] [PATCH] Support for IEEE754 binary64 format in XRLs

Steven Simpson ss at comp.lancs.ac.uk
Thu Sep 8 07:35:11 PDT 2011


On 01/09/11 16:31, Ben Greear wrote:
> On 09/01/2011 02:50 AM, Steven Simpson wrote:
>> On 31/08/11 16:18, Ben Greear wrote:
>
>>> In general, I'm amazed at how much code this took, but from skimming
>>> through
>>> it quickly, I didn't notice any issues.  I guess floating-point
>>> serialization
>>> is just a pain in the arse to do right!
>>
>> It's a matter of recognizing that double has many implementation-defined
>> characteristics, so it can't just be shifted and masked like an
>> integer.  frexp, ldexp, etc allow it to be expressed more portably, and
>> shouldn't be too costly on most systems.
>
> Could you just convert it to a string and pass it that way?

It has been suggested, but advice around the web often seems to point to 
frexp etc, and you get a fixed-size representation out of it.

> But, as long as your stuff compiles and works on stuff at least as
> old as Fedora 5, then that's good enough for me.

I seem to be hitting one brick wall after another, just trying to set up 
a fresh FC5 system that XORP can run on.

However, I did try just compiling fp64serial.c (with fp64serial.h and 
fp64.h), with gcc -std=c99, and produced no errors.  It's not so 
surprising - the features I'm after are basically a few macros that 
ought to have been in place for some time when FC5 came out.

Cheers!



More information about the Xorp-hackers mailing list