Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-science
Navigation:
Lists: gentoo-science: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-science@g.o
From: Ertugrul Soeylemez <never@...>
Subject: Re: question about signbit
Date: Fri, 28 Oct 2005 02:27:27 +0200
Miguel Barao <mjsb@...> (Thu, 27 Oct 2005 15:24:54 +0100):
> The answer is in 'man signbit'.
>
> signbit is probably just ANDing your float value with 2^31=0x80000000 which
> reads -2147483648 if considered as a signed int (like in your printf).

Yes.  The manpage doesn't say it returns 1, but it returns non-zero.
-2147483648 is non-zero.  You need to check if the value is !0, not if
the value is 1.  By the way, this holds for many boolean functions.

Regards.



-----
Get my public key via GnuPG with one of:
gpg --keyserver subkeys.pgp.net --recv-keys CE402012
gpg --keyserver ldap://keyserver.pgp.com/ --recv-keys CE402012

Or via web-based keyserver:
http://www.keyserver.de/

Key fingerprint:
0F12 0912 DFC8 2FC5 E2B8  A23E 6BAC 998E CE40 2012
Attachment:
pgp8lhBwR77pU.pgp (PGP signature)
References:
question about signbit
-- Darren Dale
Re: question about signbit
-- Marco Matthies
Re: question about signbit
-- Darren Dale
Re: question about signbit
-- Miguel Barao
Navigation:
Lists: gentoo-science: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: question about signbit
Next by thread:
Re: question about signbit
Previous by date:
Re: question about signbit
Next by date:
Re: New scientific herd tester


Updated Jun 17, 2009

Summary: Archive of the gentoo-science mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.