Go to Post what is FIRST?...It's about innovation, hard work, inspiration, teaching, learning, experiment, strategy, competition, meeting new people, being inspired, aiming high and changing paradigms...Really, FIRST is what you make of it. - jarowe [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-02-2004, 12:02
bludstayne's Avatar
bludstayne bludstayne is offline
Registered User
#0547
 
Join Date: Nov 2003
Location: Fayetteville, TN
Posts: 10
bludstayne has a little shameless behaviour in the past
Send a message via AIM to bludstayne Send a message via Yahoo to bludstayne
Square Root

How can I implement a decently fast square root function? Is there any inline assembly I can use?
__________________
I hate signatures. I wouldn't even consider having one.
  #2   Spotlight this post!  
Unread 14-02-2004, 12:48
Paul Paul is offline
lacks sanity
FRC #0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Salem,NJ
Posts: 14
Paul is an unknown quantity at this point
Send a message via AIM to Paul
Re: Square Root

Do you need to take the sqr of the number every loop? If you don't then just find the sqr of the particular number and define it as a constant. If you still need a fast sqr function let me know. Private message me cause I normally forget where I've posted recently lol.
  #3   Spotlight this post!  
Unread 14-02-2004, 13:15
Mike Bonham Mike Bonham is offline
Registered User
#0343 (Metal in Motion)
 
Join Date: Jan 2002
Location: Seneca, SC
Posts: 12
Mike Bonham is on a distinguished road
Re: Square Root

Quote:
Originally Posted by bludstayne
How can I implement a decently fast square root function? Is there any inline assembly I can use?

I'm not a programmer, and I'm not sure if this applies to your question or not, but check our Question of the Day ...

http://www.metalinmotion.com

If what you find there is of no help, I'll mention your post to our programming sub-team.
  #4   Spotlight this post!  
Unread 14-02-2004, 14:48
Paul Paul is offline
lacks sanity
FRC #0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Salem,NJ
Posts: 14
Paul is an unknown quantity at this point
Send a message via AIM to Paul
Talking Re: Square Root

try this bit of code, it should give you a quick way to find square roots... but only for ints. It is accurate up to a certian point it should have enough accuracy for anything that needs to be done with our robots. If you need anything else let me know.

inline int sroot(int n)
{
int c = 0; int a = 1;
do {n -= a; a += 2; ++c;}
while (n > 0);
return c;
}
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mulit-postioning with pnuematics this year? KenWittlief Pneumatics 101 01-02-2005 21:54
Aspartame shyra1353 Chit-Chat 8 20-01-2004 22:41
Square Rack Sketch archiver 2000 1 24-06-2002 00:09
Notes on building the Square Rack archiver 2000 1 24-06-2002 00:06
Cheaters in the bunch Hey Rumor Mill 23 14-04-2002 11:57


All times are GMT -5. The time now is 10:47.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi