swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

math library/gcc question


From: Paul Johnson
Subject: math library/gcc question
Date: Fri, 23 Jul 1999 14:50:33 -0500

I wanted Euler's constant so I included math.h.  I see in math.h there
are 2 Euler's constants, one for regular size doubles and one for long
doubles. They are named M_E and M_El.

On RedHat linux M_E works fine, but I tried to be manly (because I
wanted really long doubles :) ) and this funny thing happened.  When I
compiled it there were no warnings, the program ran, but later I found
out that the M_El was just returning a null pointer.  Then I compiled
(this is based on heatbugs) with CPPFLAGS=-DSCREENSHOTS and then I got
the compiler warning that M_El was not defined.

You can verify this for yourself. In Heatbug.m, add these two lines.
At the top:
#import <math.h>
and then in the step method, put this

printf ("Euler's regular %f and Euler's long %f \n", M_E, M_El);

THen this
$make
and the printf statements cause this:

Euler's regular 2.718282 and Euler's long -0.000000 

But with the same source code:

$ make CPPFLAGS=-DSCREENSHOT
egcs -c -Wno-import -Wno-protocol -g -O2 -DSCREENSHOT
-I/usr/include/swarm Heatbug.m
Heatbug.m: In function `-[Heatbug step]':
Heatbug.m:145: `M_El' undeclared (first use in this function)
Heatbug.m:145: (Each undeclared identifier is reported only once
Heatbug.m:145: for each function it appears in.)
make: *** [Heatbug.o] Error 1

So, I want to know
1. Why does the compiler  NOT complain to "make" the first time?
2. Have I no long doubles in linux?  I thought that was the default now,
but can't remember where I read it.

-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]