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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,dad65365cb2b3396 X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,dad65365cb2b3396 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,dad65365cb2b3396 X-Google-Attributes: gid103376,public X-Google-Thread: 106c43,dad65365cb2b3396 X-Google-Attributes: gid106c43,public X-Google-Thread: 1014db,dad65365cb2b3396 X-Google-Attributes: gid1014db,public From: fred@genesis.demon.co.uk (Lawrence Kirby) Subject: Re: The disturbing myth of Eiffel portability Date: 1996/11/17 Message-ID: <848251228snz@genesis.demon.co.uk>#1/1 X-Deja-AN: 197068454 references: <3294e64b.74799475@news2.ibm.net> x-mail2news-user: fred@genesis.demon.co.uk x-mail2news-path: genesis.demon.co.uk organization: none reply-to: fred@genesis.demon.co.uk newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.object Date: 1996-11-17T00:00:00+00:00 List-Id: In article <3294e64b.74799475@news2.ibm.net> cjames3@ibm.net "The Rt Rev'd Colin James III, KOTM 1/96" writes: >It is common knowledge that the same ANSI C source code when compiled by >different ANSI C compilers produces executables which when run yield >different, inconsistent floating point results. They should not be inconsistent for correctly written code. What can differ is the accuracy of the results. That results aren't exact in general is a fact of life with floating point. >This is due to the fact that the runtime floating point packages of ANSI C >compilers vary as to word size and are not required to conform to strict >standards, other than weasel words, as are Ada compilers. ANSI C does define minimum precision and other requirement for floating point types. The only question is whether they are adequate for your needs. ANSI C compilers on many platforms conform to the relevant IEEE floating point formats so if this is a big issue for you simply specify that your code is only certified for, say, an ANSI + IEEE 754 compliant platform. >Eiffel emits ANSI C code. > >Therefore Eiffel is in fact not truly portable and can in fact yield >different numerical results according to platform. It depends what the actual specs for floating point in Eiffel are. If they are stricter than those in ANSI C then not all implementations of Eiffel may be compliant with its specs. You don't certify code for such platforms. >That begs the following question: how can the largest Eiffel project of >over 700,000 lines of code (the CALfp bank's derivatives' program) expect >to be taken seriously if the source code when compiled on different >platforms could produce inconsistent and erroneous results. You have yet to establish that it does. >In other words, the reason that banks generally have learned to avoid C due >to floating point problems is not solved at all but rather propagated and >worsened by the questionable strategic decision to adopt Eiffel. That fact >may of course explain why no other famous banks with both US _and_ European >computer operations have jumped on the Eiffel bandwagon and predictably >would not, such as the perfect example of CitiCorp which had the first GE >bank computers about 1962. Can you think of a platform that a bank is likely to adopt these days for hosting Eiffel that doesn't support suitable floating point formats? >Don Knuth tried to get around the floating point problem in the 1960's by >suggesting in Volumes 1 and 2 of his opus to use scaled integers. It's too >bad that the immature project weenies choose not to read that classic >anymore these days and thus don't know the meaning of integer math. 5-10 years ago I might have agreed with you. However IEEE formats have been generally adopted and do guarantee exact results for calculations on integers that can be represented exactly. -- ----------------------------------------- Lawrence Kirby | fred@genesis.demon.co.uk Wilts, England | 70734.126@compuserve.com -----------------------------------------