On Mon, 19 Jul 2004, Nicholas Clark wrote:

> int
> Parrot_signbit(double x)
> {
>    union {
>        double d;
>        int i[2];
>    } u;
>    u.d = x;
> #if PARROT_BIGENDIAN
>    return u.i[0] < 0;
> #else
>    return u.i[1] < 0;
> #endif
> }

> This is buggy. Even on an IEEE platform (which this seems to be assuming)
> there's no need for the two words of the double to be stored in the same
> endian-ness order as the bits within them.

The best bet might be to introduce a Configure probe for the 'signbit'
function, and use that, if available.  Unfortunately, it's not obvious how
best to do that, particuarly if it would mean pulling in a new library
(e.g. -lsunmath on Solaris).

More to the point, I suspect this isn't the week to worry about
overhauling the Configure system :-).

-- 
    Andy Dougherty              [EMAIL PROTECTED]

Reply via email to