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: bobduff@world.std.com (Robert A Duff) Subject: Re: Java vs Ada 95 (Was Re: Once again, Ada absent from DoD SBIR solicitation) Date: 1996/10/17 Message-ID: #1/1 X-Deja-AN: 190069638 references: <325D7F9B.2A8B@gte.net> <3266DC85.D45@dynamite.com.au> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-10-17T00:00:00+00:00 List-Id: In article <3266DC85.D45@dynamite.com.au>, Alan Brain wrote: >If you really have to have 32 bits, just use > >type INTEGER_32 is new INTEGER; >for INTEGER_32'size use 32; No, that doesn't work. What you want is "type Integer_32 is range -2**31..2**31-1;". A Size clause does not affect the semantics of arithmetic. So your Integer_32 might use 16 bits or 64 bits for intermediate results. > 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? The portability issue arises for intermediate results within expressions (as in (X + Y)/2). The compiler is not required to do the arithmetic in "enough" bits to hold the intermediate result, so some compilers can overflow where others do not. Java doesn't use "enough" bits either, but at least it's always 32 or 64 bits (depending on the expression, not on the compiler). - Bob