Gentoo Archives: gentoo-science

From: Darren Dale <dd55@×××××××.edu>
To: gentoo-science@l.g.o
Subject: Re: [gentoo-science] question about signbit
Date: Sat, 22 Oct 2005 21:32:37
Message-Id: 200510221732.34058.dd55@cornell.edu
In Reply to: Re: [gentoo-science] question about signbit by Marco Matthies
1 On Saturday 22 October 2005 5:05 pm, Marco Matthies wrote:
2 > Darren Dale wrote:
3 > > On my system, SciPy's signbit function reports that the sign bit is not
4 > > set for any number, positive or negative. Could someone here help me
5 > > understand how to test the libc signbit function? I have to admit I have
6 > > no experience with C programming.
7 >
8 > Hi Darren,
9 >
10 > the signbit fuction is actually a macro (as the manpage says) defined in
11 > math.h that in turn calls the right inline function (for the type
12 > needed) which is defined in mathinline.h --- so as far as i can see,
13 > libc should not be involved, only header files. I have attached a small
14 > example below on how to use the function. Please note the use of
15 > -std=c99 (you may also use -std=gnu99) as the macro is only activated
16 > when in C99 mode and gcc's default mode is C89 ("ANSI C"). If you're
17 > interested in the differences between the two standards the wikipedia
18 > entry on c has some info:
19 > http://en.wikipedia.org/wiki/C_programming_language
20
21 Hi Marko,
22
23 Thank you for your thoughtful and informative response. I have learned a few
24 things.
25
26 Your test shows that signbit is working just fine on my system. I will discuss
27 my results with the SciPy folks.
28
29 Thanks again,
30 Darren
31 --
32 gentoo-science@g.o mailing list