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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ccb707f4c91a5f2 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Portability of Arithmetic (was: Java vs Ada 95) Date: 1996/10/18 Message-ID: <1996Oct18.074034.1@eisner>#1/1 X-Deja-AN: 190283049 x-nntp-posting-host: eisner.decus.org references: <325D7F9B.2A8B@gte.net> <1996Oct15.174526.1@eisner> x-nntp-posting-user: KILGALLEN x-trace: 845638839/848 organization: LJK Software newsgroups: comp.lang.ada Date: 1996-10-18T00:00:00+00:00 List-Id: In article , dewar@merv.cs.nyu.edu (Robert Dewar) writes: > One very important distinction is the following. In either language > you can write code where intermediate results are out of range of > the type. > > In both languages, such code may or may not work. > > In Java, if it does not work, the program execution is (in Ada-ese) > erroneous, and who knows what values you get. I thought the claim was made that those "bad" (I hope that is not a reserved word) Java results would be the same from machine to machine. That at least raises the hope that bugs which did not bite you on machine A will also not bite you on machine B. If that hope is fulfilled, then it would seem that Java arithmetic is portable. I am not saying Java arithmetic is "good", since the first person to provide subtly different input on any platform might get undesired behaviour. But to the extent that the undesired behaviour is uniform across all platforms, Java arithmetic is "portable". > In Ada, if it does not work, you will get a runtime exception. What a neat idea ! :-) Larry Kilgallen