Gentoo Archives: gentoo-science

From: Ertugrul Soeylemez <never@××××××××××.org>
To: gentoo-science@l.g.o
Subject: Re: [gentoo-science] question about signbit
Date: Mon, 24 Oct 2005 07:38:40
Message-Id: 20051023083918.6ca09df5@kill.mine.nu
In Reply to: [gentoo-science] question about signbit by Darren Dale
1 Darren Dale <dd55@×××××××.edu> (Sat, 22 Oct 2005 14:16:02 -0400):
2 > I am trying to track down the source of a bug in the SciPy development branch
3 > which, so far, has only been reported on a Gentoo platform (mine). It
4 > involves the use of the libc math function "signbit". Here is a clip from the
5 > manpage:
6 >
7 > `signbit' is a generic macro which can work on all real floating-
8 > point types. It returns a non-zero value if the value of X has
9 > its sign bit set.
10 >
11 > On my system, SciPy's signbit function reports that the sign bit is not set
12 > for any number, positive or negative. Could someone here help me understand
13 > how to test the libc signbit function? I have to admit I have no experience
14 > with C programming.
15
16 Hello Darren,
17
18 This doesn't have to be a bug. I don't know how SciPy works, but many
19 scientific libraries provide their own number types. In most number
20 encoding schemes (like floating point) the sign of a number is
21 determined by a single bit (the most significant bit of the whole
22 number, for integer types; the most significant bit of the mantissa, for
23 floating point types).
24
25 The scheme could be totally different for SciPy, so the bit actually
26 reported might be the wrong bit. This is not a bug, but rather a
27 missing feature (signbit() doesn't know the type of the number).
28
29 Regards.
30
31
32
33 -----
34 Get my public key via GnuPG with one of:
35 gpg --keyserver subkeys.pgp.net --recv-keys CE402012
36 gpg --keyserver ldap://keyserver.pgp.com/ --recv-keys CE402012
37
38 Or via web-based keyserver:
39 http://www.keyserver.de/
40
41 Key fingerprint:
42 0F12 0912 DFC8 2FC5 E2B8 A23E 6BAC 998E CE40 2012