TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

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

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

Print Reply
"Borgia, William M." <[log in to unmask]>
Mon, 18 Oct 1999 09:52:32 -0400
text/plain (16 lines)
> 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.

        You may want to try declaring the 2**4 expression as a constant,
which guarantees a static value at compile time regardless of the
implementation or level of optimization.  I hate code that relies on a
particular optimizer anyway.

        Bill Borgia