SunSparc 1+ C question

Michael J. Eager eager at ringworld.Eng.Sun.COM
Fri Dec 21 14:01:33 AEST 1990


In article <1990Dec19.185313.1116 at abcfd20.larc.nasa.gov> kristi at cscsun1.larc.nasa.gov (kristi skeens) writes:
>I need help! I am trying to use the C function pow on a Sparc 1+, but with
>no success.  I have included math.h and libmp.a, and declared the function and its
>arguments to be double as the man page said, but get a segmentation fault at the
>call. I have no documentation on this except the man page, so any words of
>wisdom would be appreciated.


Not sure why you can't use the pow function.  Make sure that both arguments
are floats.  It seems to be simple:

ringworld[123] cat t.c
#include <stdio.h>
#include <math.h>

main ()
{
   float pi = 3.14159;

   printf ("pi = %f, pi**3 = %f\n", pi, pow(pi,3.0));
}


ringworld[124] cc t.c
ringworld[125] a.out
pi = 3.141590, pi**3 = 31.006202



More information about the Comp.lang.c mailing list