home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / hp / 9396 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  1.1 KB

  1. From: dhandly@hpcuhe.cup.hp.com (Dennis Handly)
  2. Date: Tue, 18 Aug 1992 11:33:03 GMT
  3. Subject: Re: comparisons in fortran:single or double?
  4. Message-ID: <31480226@hpcuhe.cup.hp.com>
  5. Organization: Hewlett-Packard Cal Language Lab
  6. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!sdd.hp.com!hpscdc!hplextra!hpcc05!hpcuhb!hpcuhe!dhandly
  7. Newsgroups: comp.sys.hp
  8. References: <lee.714082981@ceg.uiuc.edu>
  9. Lines: 15
  10.  
  11. / lee@ceg.uiuc.edu (Chris Lee) /  1:23 pm  Aug 17, 1992 /
  12. >              A                     B
  13. >real          4.40000E-07           4.40000E-07 
  14. >double prec   4.399999795623444E-07 [unprinted]
  15.                                      ^^^^ why not print B too?
  16.  
  17. >Does the compiler actually do the comparisons in double precision or 
  18. >something like that?  My conventional wisdom tells me that since both
  19. >A and B are declared as real, the comparison should be done as reals, and
  20.  
  21. They are done as reals.
  22.  
  23. You should print both values out in hex and see if they are different.
  24. (By converting them both to real*8 you are essentially doing the same
  25. thing, making a 1 or 2 bit difference visible.)
  26.