home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / sgi / 13066 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  1.6 KB

  1. Path: sparky!uunet!sun-barr!sh.wide!wnoc-tyo-news!scslwide!wsgw!headgw!crlavgw!totsuka
  2. From: totsuka@av.crl.sony.co.jp (Takashi Totsuka)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: gcc2.2.2 on Iris Crimson (HELP!)
  5. Message-ID: <TOTSUKA.92Aug31101605@avaia.av.crl.sony.co.jp>
  6. Date: 31 Aug 92 01:16:05 GMT
  7. References: <TOTSUKA.92Aug27145458@avaia.av.crl.sony.co.jp>
  8.     <TOTSUKA.92Aug28082940@avaia.av.crl.sony.co.jp>
  9.     <1992Aug28.124816.12065@dcs.warwick.ac.uk>
  10. Sender: news@av.crl.sony.co.jp
  11. Distribution: comp
  12. Organization: SONY Corporation, JAPAN
  13. Lines: 38
  14. In-reply-to: steve@maths.warwick.ac.uk's message of 28 Aug 92 12:48:16 GMT
  15.  
  16. In article <1992Aug28.124816.12065@dcs.warwick.ac.uk> steve@maths.warwick.ac.uk (Steve Rumsby) writes:
  17.  
  18.  |Try compiling and running this (gcc-2.2.2, libg++-2.2, Irix 4.0.2):
  19.  |
  20.  |#include <stdio.h>
  21.  |#include <iostream.h>
  22.  |#include <math.h>
  23.  |
  24.  |main()
  25.  |{
  26.  |      double    x1, x2, x3;
  27.  |
  28.  |      x1 = hypot(1, 0);
  29.  |      printf("Here's a double from printf %f\n", 4.2);
  30.  |      x2 = hypot(1, 0);
  31.  |      cout << "Here's a double via iostream " << 4.2 << "\n";
  32.  |      x3 = hypot(1, 0);
  33.  |
  34.  |      printf("x1 = %f, x2 = %f, x3 = %f\n", x1, x2, x3);
  35.  |}
  36.  |
  37.  |The results I get are:
  38.  |
  39.  |Here's a double from printf 4.200000
  40.  |Here's a double via iostream 4.2
  41.  |x1 = 1.000000, x2 = 1.000000, x3 = 4503599627370497.000000
  42.  |
  43.  |That value for x3 looks a little suspicious:-)
  44.  
  45.  
  46.     I agree. I got  x3 = 1.5  which is a bit closer to the correct
  47.     value......
  48.     The problem seems to disappear when I give two non-zero arguments
  49.     such as (1,1) or (3,4). 
  50. --
  51.  
  52. Takashi Totsuka      totsuka@av.crl.sony.co.jp
  53.              SONY Corp.
  54.