From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,MSGID_SHORT autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 22 Nov 91 22:11:26 GMT From: mcsun!sun4nl!cwi.nl!dik@uunet.uu.net (Dik T. Winter) Subject: Re: Red-faced professor gets bitten in search for portability Message-ID: <4766@charon.cwi.nl> List-Id: What is ignored in this thread is that floating-point arithmetic is a bit indeterminate. I will point to the problems in this version: In article <1991Nov22.090650.28@v7.vitro.com> vaxs09@v7.vitro.com writes: > FUNCTION Trunc ( X : Float ) RETURN Integer IS > i : integer := integer ( x ); > if x < float(i) then What if x is the largest machine number smaller than i? In that case it is most probable that x is not a model number, so it is in the middle of a model interval. We find that the comparison is allowed to deliver both true and false in this case. On some machines you will indeed find false! Even the comparison "x > float(i)" is allowed to return true (but I do not know machines where that will happen). The LRM clearly states what happens when you compare numbers in different model intervals, or when you compare different model numbers. It also says that comparison of numbers in the same model interval is indeterminate. > return i - 1; > else > return i; > endif; > END Trunc; -- dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland dik@cwi.nl (from bitnet also probably: dik@mcvax)