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