public inbox for gentoo-science@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ertugrul Soeylemez <never@drwxr-xr-x.org>
To: gentoo-science@lists.gentoo.org
Subject: Re: [gentoo-science] question about signbit
Date: Fri, 28 Oct 2005 02:27:27 +0200	[thread overview]
Message-ID: <20051028022727.336eaff7@kill.mine.nu> (raw)
In-Reply-To: <200510271524.54132.mjsb@ramses.inesc-id.pt>

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

Miguel Barao <mjsb@ramses.inesc-id.pt> (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 #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-10-28  0:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-22 18:16 [gentoo-science] question about signbit Darren Dale
2005-10-22 21:05 ` Marco Matthies
2005-10-22 21:32   ` Darren Dale
2005-10-22 21:39   ` Marco Matthies
2005-10-27 12:52   ` Darren Dale
2005-10-27 14:24     ` Miguel Barao
2005-10-28  0:27       ` Ertugrul Soeylemez [this message]
2005-10-28 15:40     ` Marco Matthies
2005-10-28 16:00       ` Darren Dale
2005-10-23  6:39 ` Ertugrul Soeylemez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051028022727.336eaff7@kill.mine.nu \
    --to=never@drwxr-xr-x.org \
    --cc=gentoo-science@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox