delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/17/00:52:32

From: Prashant Ramachandra <rprash AT wilco-int DOT com>
To: "'djgpp AT delorie DOT com'" <djgpp AT delorie DOT com>
Message-ID: <5BF60CD649EDD411A04600B0D049F53A09257B@hydmail02.hyd.wilco-int.com>
Subject: RE: Whats up with sqrt?
Date: Sat, 17 Mar 2001 11:19:15 +0530
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Reply-To: djgpp AT delorie DOT com

On Saturday, March 17, 2001 10:49 AM, James W Sager Iii
[SMTP:sager+@andrew.cmu.edu] wrote:
| For me, the function sqrt() which obviously returns a square root
| is
| messing up for me on moderately large numbers.
| 
| anything below 10,000 and it gives me about the right answer, but at
| like:
| 
| range = sqrt(300,000)
| 
| I get a 0 as a return value?  I tried doing:

Don't use commas while sending parameters. It's giving you the square root
of the second parameter, i.e. 0.

range = sqrt (300000.0);

is the right way to do it.
--
Prashant TR <tr AT midpec DOT com>
Web: http://www.midpec.com/


----------------------------------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential 
and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please 
contact the sender and delete the material from any computer.
----------------------------------------------------------------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019