Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!sugar!peterc From: peterc@Sugar.NeoSoft.com (Peter Creath) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW and Think Summary: I'm going inSANE with Think C! (HELP! I can't do sines!) Message-ID: <1991Jun29.165143.12263@Sugar.NeoSoft.com> Date: 29 Jun 91 16:51:43 GMT Article-I.D.: Sugar.1991Jun29.165143.12263 References: <1991Jun25.180736.28590@gn.ecn.purdue.edu> <1991Jun29.075457.28418@metro.ucc.su.OZ.AU> Organization: Sugar Land Unix -- Houston, TX Lines: 23 OK, folks, how the HELL do I calculate a sine from Think C? I have tried using FracSin, but Think C doesn't seem to know how to handle Fract's and Fixed's. I can declare them just fine, but when I try something like defining a Fixed=0.05*(x^2+y^2); and I should be getting 9.25 (I checked on my calculator), Think C puts what it thinks is 9 into the Fixed. Upon examining the exact hex data, Think C isn't converting it to a Fixed. It's converting it to a long. So, when I go to FracSin and Think C tries to put .471.... into a Fract, my debugger says it's 85-thousand something. Of course, when sines should be from -1 to 1, that does sorta screw up any calculations you were doing... So is there any way to tell Think C how to handle Fract's and Fixed's? Or is there an easier way to calculate a sine? (I've got an SE/30, so I've got the 68881) PLEASE respond in E-mail. My news system doesn't allow threading... -- peterc@sugar.neosoft.com "Listen, there's a hell of a good peterc@sugar.hackercorp.com universe next door. Let's go!" (take your pick) -e e cummings --