TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Proportional Font
Show HTML Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Subject:
From:
Tucker Taft <[log in to unmask]>
Date:
Fri, 13 Nov 1998 17:05:57 -0500
X-To:
Reply-To:
Tucker Taft <[log in to unmask]>
Parts/Attachments:
text/plain (36 lines)
> From [log in to unmask] Thu Nov 12 09:33 EST 1998
> Date:         Thu, 12 Nov 1998 09:30:30 -0500
> From: "W. Wesley Groleau x4923" <[log in to unmask]>
> Subject:      Re: Portability (was: Ada in CFD)
> To: [log in to unmask]
>
> > For Ada we would write
> >    type Jint is range -2**31 .. 2**31 - 1;
> >    for Jint'Size use 32;
>
> Or how about:
>
> package Interfaces.Java is
>    ...
>    type int is .....
>
> > And this will work on any platform where the Ada compiler
> > can handle 32 bit numbers.
>
> Actually, I have seen at least one Ada _83_ compiler that could handle
> 32-bit numbers, but could not handle the above declaration.  Due to
> precedence rules, they felt they had to compute 2**31 first, and then
> print
>
>    type ..... is range -2**31 .. 2**31 - 1;
>                         ^        ^
>    (cryptic message that has something to do with available machine types)
>
> The ugly workaround was
>
>    Big_Number : constant := 2**30;
>
>    type ..... is range (- Big_Number - Big_Number)      ..
>                        ((Big_Number - 1) + Big_Number);
>

ATOM RSS1 RSS2