Expressions in initializers

Ken Lerman lerman at stpstn.UUCP
Wed Mar 6 03:56:13 AEST 1991


In article <1991Mar4.144939.8311 at ux1.cso.uiuc.edu> mcdonald at aries.scs.uiuc.edu (Doug McDonald) writes:
>
>sqrt(2.0) is an expression. It CAN be evaluated at compile time. Perhaps
>some people don't want to write compilers that do that (i.e. they are too
>lazy), but it most certainly CAN be evaluated.
>
>Perhaps a different explanation is appropriate?
>
>Doug McDonald

It may be true that under ANSI C sqrt(2.0) CAN be evaluated at compile
time.  But prior to ANSI, the value of sqrt(2.0) could not be because
the programmer was free to call any function he wanted "sqrt".  Prior
to ANSI, the semantics of sqrt might not be determined until link
time.

Ken



More information about the Comp.lang.c mailing list