From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!AJPO.SEI.CMU.EDU!nyberg From: nyberg@AJPO.SEI.CMU.EDU (Karl Nyberg) Newsgroups: comp.lang.ada Subject: Floating point attribute verification Program Message-ID: <8803111259.AA08022@ajpo.sei.cmu.edu> Date: 11 Mar 88 12:59:19 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: This program was submitted to info-ada. It was deemed too large to pass through the vraious mail networks (something like 37K bytes). I have separated the program into the file ~ftp/public/infoada/float.ada and float.note. The file float.note is attached. -- Karl -- Subject: Floating point attribute verification. Attached you will find a program that will verify the correctness of the values returned by floating point type attributes. This program was written within the framework of the Ada Europe Numerics Working Group, and I thank the group members for there input and advise. Attributes are crucial when an attempt is made to write a portable problem. And it is, of course, essential that the values returned are correct. But even with my current, limited, knowledge I know that for every floating point type attribute there is at least one compiler system that returns the wrong value! And only a minority (2) of the compiler systems tested so far (9) return (apparently) correct values in all cases. But I know from other sources that one of these 2 compilers gives wrong results in a number of other cases, and the other compiler gives wrong results when a port to a different machine is used. It is clear that a program for the verification of the attributes would be appropriate in the validation suite. The problem is that validation programs should be portable to all machines and compilers, however weird they are. But this program relies on some properties of the hardware, and I do not know of a method to avoid this. The most important property this program requires is that multiplication of a positive floating point number by the machine radix either yields an overflown result (which might have exponent wrap-around) or the correct result. I know of at least one binary machine where multiplication of a floating point number by two might loose precision (though there is not yet an Ada compiler on it). So this program will fail on that machine without any doubt. As it is not feasible to put this program in the validation suite, I intend to have this program put to as wide a public as possible. I would appreciate if you, when you compile and execute this program, would mail the results to me. My addresses are in the header page of the output. Also feel free to communicate any problems or errors you encounter with the program, so that I am able to adjust the program accordingly (no program is perfect). dik t. winter, cwi, amsterdam, nederland Internet: dik@cwi.nl Bitnet : dik@mcvax (this is a nickname, do NOT use hamcwi6, it will fail) UUCP : ....uunet!dik@cwi.nl (or something like that)