delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/17/02:27:18

From: Prashant Ramachandra <rprash AT wilco-int DOT com>
To: "'djgpp AT delorie DOT com'" <djgpp AT delorie DOT com>
Message-ID: <5BF60CD649EDD411A04600B0D049F53A092580@hydmail02.hyd.wilco-int.com>
Subject: RE: Whats up with sqrt?
Date: Sat, 17 Mar 2001 12:47:44 +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 12:28 PM, James W Sager Iii
[SMTP:sager+@andrew.cmu.edu] wrote:
| 
| 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

FYI, I just tried this small program and it worked perfectly for me.

#include <math.h>
#include <stdio.h>

int main()
{
        double x = 10001.0;
        printf ("%lf", sqrt (x));
        return 0;
}

I got the result 100.005000, which looks ok.

Command line I used was:

gcc -o test test.c -lm

So, it's not a bug in the library.
--
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