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: 103376,3ccb707f4c91a5f2 X-Google-Attributes: gid103376,public From: Alan Brain Subject: Re: Java vs Ada 95 (Was Re: Once again, Ada absent from DoD SBIR solicitation) Date: 1996/10/17 Message-ID: <3266DC85.D45@dynamite.com.au>#1/1 X-Deja-AN: 190018487 references: <325D7F9B.2A8B@gte.net> content-type: text/plain; charset=us-ascii organization: @Home mime-version: 1.0 reply-to: aebrain@dynamite.com.au newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (Win16; I) Date: 1996-10-17T00:00:00+00:00 List-Id: Robert A Duff wrote: > > How about portability of arithmetic? In Java, int is always exactly 32 > bits 2's complement. In Ada, Integer is whatever the machine supports. > And if I say "type T is range 1..100;" I might get 32-bit arithmetic, or > I might get 8-bit arithmetic, or who-knows-what. If you really have to have 32 bits, just use type INTEGER_32 is new INTEGER; for INTEGER_32'size use 32; Then use INTEGER_32 instead of Integer.That at least gets the size right. Similar clauses give you 2's complement. But unless interfacing with an IO device or some such, what the heck does it matter whether it's 8,16,32,48,12,19 or whatever bits, providing it's enough? > On the other hand, at least Ada notifies you of overflows -- in Java, it > just silently gets the wrong answer. (This is the C and C++ culture -- > Java inherits much more than just syntax from that culture.) Concur. ---------------------- <> <> How doth the little Crocodile | Alan & Carmel Brain| xxxxx Improve his shining tail? | Canberra Australia | xxxxxHxHxxxxxx _MMMMMMMMM_MMMMMMMMM ---------------------- o OO*O^^^^O*OO o oo oo oo oo By pulling Maerklin Wagons, in 1/220 Scale