[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-standards
Subject:    Re: signbit() implementation question
From:       Bruce Evans <bde () zeta ! org ! au>
Date:       2003-02-10 19:25:21
[Download RAW message or body]

On Mon, 10 Feb 2003, Mike Barcroft wrote:

> I'm wondering if any casts from float->double or long double->double
> will cause the sign-bit to change.  In my implementation I just have
> the macro pass its argument to a function that takes a double for its
> argument.  In the tests I've done the sign-bit never changes with
> these casts, but I don't know if this is guaranteed to work for all
> values or whether this is completely portable.

Preserving the sign bit in conversions and rounding, etc. is required
by at least ieee854 (section 6.3), so I think all reasonable hardware
preserves it.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic