home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!sh.wide!wnoc-tyo-news!scslwide!wsgw!headgw!crlavgw!totsuka
- From: totsuka@av.crl.sony.co.jp (Takashi Totsuka)
- Newsgroups: comp.sys.sgi
- Subject: Re: gcc2.2.2 on Iris Crimson (HELP!)
- Message-ID: <TOTSUKA.92Aug31101605@avaia.av.crl.sony.co.jp>
- Date: 31 Aug 92 01:16:05 GMT
- References: <TOTSUKA.92Aug27145458@avaia.av.crl.sony.co.jp>
- <TOTSUKA.92Aug28082940@avaia.av.crl.sony.co.jp>
- <1992Aug28.124816.12065@dcs.warwick.ac.uk>
- Sender: news@av.crl.sony.co.jp
- Distribution: comp
- Organization: SONY Corporation, JAPAN
- Lines: 38
- In-reply-to: steve@maths.warwick.ac.uk's message of 28 Aug 92 12:48:16 GMT
-
- In article <1992Aug28.124816.12065@dcs.warwick.ac.uk> steve@maths.warwick.ac.uk (Steve Rumsby) writes:
-
- |Try compiling and running this (gcc-2.2.2, libg++-2.2, Irix 4.0.2):
- |
- |#include <stdio.h>
- |#include <iostream.h>
- |#include <math.h>
- |
- |main()
- |{
- | double x1, x2, x3;
- |
- | x1 = hypot(1, 0);
- | printf("Here's a double from printf %f\n", 4.2);
- | x2 = hypot(1, 0);
- | cout << "Here's a double via iostream " << 4.2 << "\n";
- | x3 = hypot(1, 0);
- |
- | printf("x1 = %f, x2 = %f, x3 = %f\n", x1, x2, x3);
- |}
- |
- |The results I get are:
- |
- |Here's a double from printf 4.200000
- |Here's a double via iostream 4.2
- |x1 = 1.000000, x2 = 1.000000, x3 = 4503599627370497.000000
- |
- |That value for x3 looks a little suspicious:-)
-
-
- I agree. I got x3 = 1.5 which is a bit closer to the correct
- value......
- The problem seems to disappear when I give two non-zero arguments
- such as (1,1) or (3,4).
- --
-
- Takashi Totsuka totsuka@av.crl.sony.co.jp
- SONY Corp.
-