Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!ncar!boulder!sunybcs!rutgers!bpa!cbmvax!vu-vlsi!psuvax1!psuvm.bitnet!cxt105 From: CXT105@PSUVM.BITNET (Christopher Tate) Newsgroups: comp.sys.mac.programmer Subject: Stupid LightspeedC question Message-ID: <72138CXT105@PSUVM> Date: 17 Feb 89 16:34:51 GMT Organization: Ghostwheel, Inc. Lines: 31 Ok, here's another one. I've written a couple of functions to convert from degrees to radians and back, and I can't get them to work correctly (read: the way I want them to). When I use the following function declaration: #include /* this gets the PI definition */ double deg_to_rad(x) double x; { return (x*PI/180); } the routine returns the same value regardless of what I pass as x. The only way I have found to get it to work (based on the assumption that a parameter of type double cannot be passed ordinarily, since it's 10 bytes long) is to declare the function thus: #include double deg_to_rad(x) double *x; { return ((*x)*PI/180); } and pass a pointer to a predefined variable of type double as x. The question is this: is there any way I can rig it so I can pass the argu- ment by value (as in the first example), so I can use constants as parameters? ------- Christopher Tate || "I hate quotations!" -- Ralph Waldo Emerson