Click to See Complete Forum and Search --> : C++ square root command........


m316foley
11-29-2001, 08:23 PM
whats the square root command in c++?

------------------
Amd Athlon 1.4ghz Soon To Be @ 1.6ghz
Asus A7m266
2-80gig WD Hard drives
512megs of DDR Ram
Gainward Geforce 3 Powerpack @ 220/515
Soundblaster Live Platinum 5.1
3Com EtherLink 10/100 3CR990-TX-97
Creative Blaster v.92 Modem
Sony Trinitron 21inch Monitor
Plextor 24X Burnproof Cd-Writer
Pioneer 16X DVD Drive
Klipsch Promedia 5.1 Surround Sound
Sony 3.5inch Floppy Drive
Windows 2000 Pro - Of Course...
-------------------------
*HAVE A NICE DAY*

driver
11-29-2001, 09:50 PM
In C it was

#include <math.h>
double sqrt(double num);

where the square root is returned. If num is negative, an error occurs. This should still be valid in C++.

Galen of Edgewood
11-30-2001, 09:57 AM
1st of all, congrats on Genetic! http://www.sharkyforums.com/ubb/smile.gif

driver's suggestion would work. Another option is also in math.h

double pow( double x, double y );

Just raise x to .5 and you'd get the same thing. This might be a good command to know if you need to raise things to powers.

------------------
Dragon of the OC Crusaders

The race is not always to the swift, nor the battle to the strong, but that's the way to bet.
**-- Damon Runyon

[This message has been edited by Galen of Edgewood (edited November 30, 2001).]

bIOHZRd
11-30-2001, 12:10 PM
But the real question is, which one is fast? http://www.sharkyforums.com/ubb/smile.gif

------------------
<A HREF="http://home.columbus.rr.com/bio/benchmarks.htm" TARGET=_blank>-=T'bird 1000=- | -=768 Crucial PC133=- | -=GeForce2 MX 32mb eVGA=-
-=Abit KT7a-Raid=- | -=40gb ata/100 WD=- | -=Sound Blaster Live!=-</A>