Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!n8emr!uncle!oink!jep From: jep@oink.UUCP (James E. Prior) Newsgroups: comp.graphics Subject: Re: APPROXIMATING SQUARE_ROOT Message-ID: <47@oink.UUCP> Date: 29 Nov 89 00:19:47 GMT References: <1989Oct26.155201.5087@rpi.edu> <14397@well.UUCP> <367@oscsuna.osc.edu> <63127@psuecl.bitnet> <542@xdos.UUCP> Reply-To: jep@oink.UUCP (James E. Prior) Organization: Random Prime Research Institute Columbus, Ohio Lines: 12 In article <63127@psuecl.bitnet> c9h@psuecl.bitnet writes: >Even with floating point numbers, and divide by 2 can be extremely fast >if coded such that the exponent is simply decremented by one. I would hope >that many compilers do this optimization automatically, but I don't know. FYI, some machines can do floating points shifts (virtual *2 and /2) in their instruction set. As I recall (I might be wrong, please no flames), the IBM-370s had floating point shifts. A bit of an oddity, their floating point format was base 16, not base 2. It complicates the shifts a little, but the idea's the same. -- Jim Prior jep@oink osu-cis!n8emr!oink!jep N8KSM Brought to you by Super Global Mega Corp .com