Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Fixed Point Square Root   Message List  
Reply | Forward Message #14654 of 15019 |
Can someone give me a good fixed point square root algorithm? I need
to get the square root of a 22.10 fixed point number. I am brain
dead when it comes to elementary algebra like this. Please be kind.

I'd like a general algorithm in C or psuedocode that could be used for
different fraction sizes just be changing a #define value. I've
searched and found some that worked for specific cases (like on that
was 2.30) but I could figure out how to adapt it for 22.10.

Thanks in advance,
Tom






Mon Dec 8, 2003 10:24 pm

SorcererXIII
Offline Offline
Send Email Send Email

Forward
Message #14654 of 15019 |
Expand Messages Author Sort by Date

Can someone give me a good fixed point square root algorithm? I need to get the square root of a 22.10 fixed point number. I am brain dead when it comes to...
Thomas
SorcererXIII
Offline Send Email
Dec 8, 2003
10:36 pm

input: a = number to be squared x = estimated result (can be any numberm but the better estimation the better result) output: x = close to sqrt(a) algorithm:...
porneL
pornelkurna
Offline Send Email
Dec 9, 2003
12:15 am

... For reference, here's an example of a 2.30 square root function: http://www.worldserver.com/turk/opensource/FractSqrt.c.txt ... The given code gives...
Damian Yerrick
yerricde
Offline Send Email
Dec 9, 2003
4:02 am

Thanks, I'll try that out . . . for some reason my brain is not working on this issue (years of only having to press the square root key on a calculator?). I...
Thomas
SorcererXIII
Offline Send Email
Dec 9, 2003
3:32 pm

Ok, testing has revealed that the bios function is a good 10 times faster than the 2.30 function (I didn't measure it precisely - all I need to know is that...
Thomas
SorcererXIII
Offline Send Email
Dec 9, 2003
4:31 pm

Do bear in mind that if you test the speed of the BIOS functions on an emulator the result will not necessarily be indicative of what happens on real hardware....
Graham Wall
prizeonion
Offline Send Email
Dec 9, 2003
5:40 pm

You are right, what an idiot I am ('specially considering that I did that very thing two years ago when emulating bios for cowbite). I need to get more sleep....
Thomas
SorcererXIII
Offline Send Email
Dec 9, 2003
10:12 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help