From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.50) id 1EVI6j-0006Of-2h for garchives@archives.gentoo.org; Fri, 28 Oct 2005 00:28:33 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id j9S0RXgb028656; Fri, 28 Oct 2005 00:27:33 GMT Received: from mout2.freenet.de (mout2.freenet.de [194.97.50.155]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id j9S0RWIR027994 for ; Fri, 28 Oct 2005 00:27:33 GMT Received: from [194.97.50.144] (helo=mx1.freenet.de) by mout2.freenet.de with esmtpa (Exim 4.53-RC2) id 1EVI5k-0003nR-M6 for gentoo-science@lists.gentoo.org; Fri, 28 Oct 2005 02:27:32 +0200 Received: from p54a1789c.dip.t-dialin.net ([84.161.120.156] helo=kill.mine.nu) by mx1.freenet.de with esmtpsa (ID milch4@freenet.de) (TLSv1:AES256-SHA:256) (Exim 4.54 #12) id 1EVI5k-0001aK-CM for gentoo-science@lists.gentoo.org; Fri, 28 Oct 2005 02:27:32 +0200 Date: Fri, 28 Oct 2005 02:27:27 +0200 From: Ertugrul Soeylemez To: gentoo-science@lists.gentoo.org Subject: Re: [gentoo-science] question about signbit Message-ID: <20051028022727.336eaff7@kill.mine.nu> In-Reply-To: <200510271524.54132.mjsb@ramses.inesc-id.pt> References: <200510221416.03348.dd55@cornell.edu> <435AA97C.7020103@gmx.net> <200510270852.35524.dd55@cornell.edu> <200510271524.54132.mjsb@ramses.inesc-id.pt> X-Mailer: you will never know 0.1.0 X-Face: $BX,+"XNhBb/A9xR2?Wg&w$*}'wQ\Txs(7CO)]QtO:&P(zUl=s/G|_g^ihH]%Vn}84["cma 01SgN/vcux&B>SW2ixv8qeYMjlT!*U List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-science@gentoo.org Reply-to: gentoo-science@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Signature_Fri__28_Oct_2005_02_27_27_+0200_RZiKILk7ybx5Z3RQ; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Archives-Salt: 1f9e8a69-022f-4562-bdc5-d076352c8d1a X-Archives-Hash: 64284d3f50f43779be7d97ea363cf50f --Signature_Fri__28_Oct_2005_02_27_27_+0200_RZiKILk7ybx5Z3RQ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Miguel Barao (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=3D0x80000000 w= hich > 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 --Signature_Fri__28_Oct_2005_02_27_27_+0200_RZiKILk7ybx5Z3RQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDYXBya6yZjs5AIBIRAtr+AJ9huTf7Uuh5+S3y9hTHXumUnClpwQCfc00u lT15iPk6jLqzzAArqSonkKw= =BxOF -----END PGP SIGNATURE----- --Signature_Fri__28_Oct_2005_02_27_27_+0200_RZiKILk7ybx5Z3RQ-- -- gentoo-science@gentoo.org mailing list