Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!sugar!peterc From: peterc@Sugar.NeoSoft.com (Peter Creath) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW and Think Summary: more inSANEity... This time it's square roots... Message-ID: <1991Jun30.042022.19588@Sugar.NeoSoft.com> Date: 30 Jun 91 04:20:22 GMT References: <1991Jun25.180736.28590@gn.ecn.purdue.edu> <1991Jun29.165143.12263@Sugar.NeoSoft.com> Organization: Sugar Land Unix -- Houston, TX Lines: 22 Well, I figured out a way to do sines & cosines (I think): I multiply floats (small ones) by 30000, convert that to long, that to Fixed, that to Frac. Convert a 30000 long to Fixed to Frac. Do a FracDiv of the multiplied original number by the Frac'd 30000 to get the original number. The perform the operation on that. (FracSin, that is) Of course, now there's another problem. This system won't work with anything over about 1.1. So to solve that I'm trying to take the reciprocal and take the square root of that (FracSqrt) and then take the reciprocal of THAT. Horribly inefficient. I intensely dislike having to do it this way. Especially with square roots. Is Apple really that short-sighted to put in a square root function that only works with values from -2 to 1.999999999? Or is there some call other than FracSqrt for square roots? --