Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!ringworld.Eng.Sun.COM!eager From: eager@ringworld.Eng.Sun.COM (Michael J. Eager) Newsgroups: comp.lang.c Subject: Re: SunSparc 1+ C question Message-ID: <4966@exodus.Eng.Sun.COM> Date: 21 Dec 90 03:01:33 GMT References: <1990Dec19.185313.1116@abcfd20.larc.nasa.gov> Sender: news@exodus.Eng.Sun.COM Organization: Sun Microsystems, Mt. View, Ca. Lines: 26 In article <1990Dec19.185313.1116@abcfd20.larc.nasa.gov> kristi@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 #include 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