integer square roots

Started by
15 comments, last by akiinao 21 years, 10 months ago
do you guys know a fast method to find integer square roots? i mean sqrt(10) = 3. P.S: editing for correcting gammar mistakes [edited by - akiinao on June 10, 2002 5:25:14 PM]
Advertisement
simply do this:

int iResult = (int)sqrt(value);

There is no faster way to get square roots. Thats why you should avoid using them when possible
PUTZ!! what a dumb!
I'm talkin' about algorithms... (that formula i know)

[edited by - akiinao on June 5, 2002 3:52:49 PM]
quote:Original post by Kern
simply do this:

int iResult = (int)sqrt(value);

There is no faster way to get square roots. Thats why you should avoid using them when possible


dat was se pratty dumb thang to says!

Of coarse there are faster ways of getting integer square roots! And your crazy hungarian notation of iResult makes me want to vomit!

Try http://www.numbertheory.org/calc/krm_calc.html, I think they might have what your looking for!
"I want to make a simple MMORPG first" - Fenryl
Sheesh, welcome to the forums, Kern!

You didn''t say you were looking for an algorithm, akiinao.
It's not what you're taught, it's what you learn.
http://www.azillionmonkeys.com/qed/sqroot.html
Thanks to everyone who provided constructive responses to akiinao''s post.

I admire Richard Feynman, the late physicist who, in his own words, was a "curious character." I''ve read some of his memoirs, and it seems that a few other rather famous scientists (including, I think, Fermi) would always ask Richard questions even when he was a lowly student and they were noble prize-winning famous big-time scientists. Why, you ask? Because Richard didn''t know he was supposed to bow down and worship they ground that they walked on. While their lesser professional peers would generally agree with their theories, Richard would always be honest, telling the big-guys when he thought they were full of shit. They appreciated his honesty! I do imagine that he was fairly courteous to them, though! I guess he probably never called them "dumbass!"

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
quote:Original post by grhodes_at_work
I guess he probably never called them "dumbass!"

eehehheehe, I can hear it through the sands of time:
"Fermi, you're such a dumbass. I can't believe I hang around with ghey guys like you - like bombarding uranium with inert neurons will make anything special happen, I don't care how fast... OH MY GOD"


Magmai Kai Holmlor

"Oh, like you've never written buggy code" - Lee


[edited by - Magmai Kai Holmlor on June 5, 2002 7:22:30 PM]
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
I really liked the play about him, Q.E.D., did anyone else see that? Very good play!

Oh, and I diddn''t mean to sound stuck up about integral algorithms, I was saying it in a joking sense. You really think I''d make fun of hungarian notation? .bSen
"I want to make a simple MMORPG first" - Fenryl
thanx guys.
i''ll read that links
;-)

This topic is closed to new replies.

Advertisement