Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!mailrus!purdue!decwrl!sun!quintus!ok From: ok@quintus Newsgroups: comp.lang.fortran Subject: .GT. is not transitive Keywords: interest amusement floating-point Message-ID: <791@quintus.UUCP> Date: 2 Dec 88 06:03:07 GMT Sender: news@quintus.UUCP Reply-To: ok@quintus () Organization: Quintus Computer Systems, Inc. Lines: 20 I offer the following F77 program for your interest and amusement. On VAXen it prints "BROKEN". On Sun3s it prints "BROKEN". On a Sequent (BSD UNIX, 386/387 processor, own Fortran) it prints "OK". I know why it fails on the machines where it fails and why it works on the Sequent. The numeric values are appropriate for machines with 32-bit INTEGERs, 32-bit IEEE REALs, and 64-bit IEEE DOUBLE PRECISIONs. INTEGER X DOUBLE PRECISION Y REAL Z X = 1000000002 Y = 1000000001.0D0 Z = 1000000000.0E0 IF (X.GT.Y .AND. Y.GT.Z .AND..NOT. X.GT.Z) STOP 'BROKEN' STOP 'OK' END