Re: [xml] XPath fix



Apologies if this is a hideous cheat, but...
The code in trionan always appears to work off the idea that a double is
64
bits long.
As the sign is the 64th bit (the one on the left), wouldn't a simple way
of
checking the sign just be to right shift the value, i.e.

int trio_get_sign(double a) {
    return a>>63;
}

I suspect there might be a more scientific way, but this seems to be the
simplest, and avoids doing three different things depending on the
#defines
/ platform / implementation.


Ah. Scratch that idea - doesn't compile, and casting it to a long (or
combination of)
is far too messy / implementation specific. Let's try the scientific method
after
all...
Richard



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]