Re: An interesting Problem

Scott Hopwood (shopwood@nospam.staff.cs.su.oz.au)
Mon, 13 Feb 1995 13:54:52 +1000 (EST)

Thank you Jeremy! I'd slipped on the headers, and forgot the math.h. I
couldn't use -Wall on the SOCS machines as I was using String.h (Its
*full* of warnings). On the SOCS machines it never became a problem, on
the new machines it was.

Another problem solved by the glorious greater mind of ProgSoc.

On Fri, 10 Feb 1995, Jeremy Fitzhardinge wrote:

> > I have a problem. My computer (or more accuratly, Sydney Uni's computer)
> > can't do maths (and before you ask, it's *not* a pentium, it's a Sparc1000

[Problem Removed]

> Make sure you've got a prototype for acos() in scope (ie, you're including
> math.h). That's all I can think of for the moment. Does compiling with -Wall
> tell you anything?
>
> : suede:8; cat x.c
> #include <stdio.h>
>
> int main(int argc, char *argv[])
> {
> double x = acos(0.0);
>
> printf("acos(0.0) = %f\n", x);
>
> exit(1);
> }
> : suede:8; gcc -Wall -o x x.c -lm
> x.c: In function `main':
> x.c:5: warning: implicit declaration of function `acos'
> : suede:8; ./x
> acos(0.0) = 0.000000
> : suede:8; cat x1.c
> #include <stdio.h>
> #include <math.h>
>
> int main(int argc, char *argv[])
> {
> double x = acos(0.0);
>
> printf("acos(0.0) = %f\n", x);
>
> exit(1);
> }
> : suede:8; gcc -Wall -o x x1.c -lm
> : suede:8; ./x
> acos(0.0) = 1.570796
>
> J

Scott Hopwood 'A monkey throws,
(02) 351-3788 A spinning bone,
shopwood@nospam.staff.cs.su.oz.au A silent spaceship'
shopwood@nospam.socs.uts.edu.au