TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Öhlund Magnus <[log in to unmask]>
Reply To:
Öhlund Magnus <[log in to unmask]>
Date:
Mon, 18 Oct 1999 15:07:56 +0200
Content-Type:
text/plain
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