Message-ID: <8ugkfne00UjFETbF0i@andrew.cmu.edu> Date: Sat, 17 Mar 2001 01:57:55 -0500 (EST) From: James W Sager Iii To: djgpp AT delorie DOT com Subject: Re: Whats up with sqrt? In-Reply-To: <5BF60CD649EDD411A04600B0D049F53A09257B@hydmail02.hyd.wilco-int.com> References: <5BF60CD649EDD411A04600B0D049F53A09257B AT hydmail02 DOT hyd DOT wilco-int DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Excerpts from netnews.comp.os.msdos.djgpp: 17-Mar-101 RE: Whats up with sqrt? by Prashant Ramachandra AT wil > > 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. I'm sorry, I wasn't using commas... but at the same time I wasn't using .0. so perhaps it was being type casted wrong. but I tested it a=sqrt(10001.0); returns 100516 Ok, that makes no sense what so ever well at least I have my own function to do it no biggie