TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Proportional Font
Show HTML Part by Default
Condense Mail Headers

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

Print Reply
Content-Transfer-Encoding: quoted-printable
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
From: Öhlund Magnus <[log in to unmask]>
Date: Mon, 18 Oct 1999 15:07:56 +0200
Content-Type: text/plain; charset="iso-8859-1"
MIME-Version: 1.0
Reply-To: Öhlund Magnus <[log in to unmask]>
Parts/Attachments: text/plain (25 lines)
Hi,

I wonder if the Rational compiler is smart enough to understand that for
example in the following expression

Tmp : Integer;

Tmp := Tmp + 2**4;

the compiler will understand that 2**4 is a constant ( =16 ) and replace the
calculation with its value ( = 16 ).

My code looks much clearer if I use expressions like 2**4 instead of 16, but
then there is the question of execution time also. I don't want the
calculation to take place over and over again, since the function is called
quite often.

I hope I don't offend any Rational people with this question.

Thanks,

Magnus Öhlund

Celsius Aerotech

ATOM RSS1 RSS2