Gentoo Archives: gentoo-science

From: Ertugrul Soeylemez <never@××××××××××.org>
To: gentoo-science@l.g.o
Subject: Re: [gentoo-science] question about signbit
Date: Fri, 28 Oct 2005 00:28:33
Message-Id: 20051028022727.336eaff7@kill.mine.nu
In Reply to: Re: [gentoo-science] question about signbit by Miguel Barao
1 Miguel Barao <mjsb@×××××××××××××××.pt> (Thu, 27 Oct 2005 15:24:54 +0100):
2 > The answer is in 'man signbit'.
3 >
4 > signbit is probably just ANDing your float value with 2^31=0x80000000 which
5 > reads -2147483648 if considered as a signed int (like in your printf).
6
7 Yes. The manpage doesn't say it returns 1, but it returns non-zero.
8 -2147483648 is non-zero. You need to check if the value is !0, not if
9 the value is 1. By the way, this holds for many boolean functions.
10
11 Regards.
12
13
14
15 -----
16 Get my public key via GnuPG with one of:
17 gpg --keyserver subkeys.pgp.net --recv-keys CE402012
18 gpg --keyserver ldap://keyserver.pgp.com/ --recv-keys CE402012
19
20 Or via web-based keyserver:
21 http://www.keyserver.de/
22
23 Key fingerprint:
24 0F12 0912 DFC8 2FC5 E2B8 A23E 6BAC 998E CE40 2012