Re: what is wrong with this code?can someone walk me through this?



glen herrmannsfeldt wrote:

pixel wrote:

*** Hendrickson wrote:


This is a potentially worse problem. The expression (4.0/3.0)
will be computed as approximately 1.333333 and then converted to
double precision and become approximately 1.3333330000000.


Unless you're running a reality altering arithmetic of the Clinton
variety it's going to be something like (precision conversion noise),


1.33333337306976


with the odds of your speculative outcome coming up at about 1 in 10^7,
and more likely - never.


I don't know if there are Fortran compilers for IBM z/Architecture
machines with decimal floating point yet, but when there are the
probability will be much higher than 1D-7.

I'm not sure either. We run Z/OS and Z/VM and the same old VS Fortran 77 compiler (functionally at least) is in use.


-- glen



--

Gary Scott
mailto:garylscott@sbcglobal dot net

Fortran Library: http://www.fortranlib.com

Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html

If you want to do the impossible, don't hire an expert because he knows it can't be done.

-- Henry Ford
.


Quantcast