nonportable code or incorrect compilers?

Chris Torek chris at mimsy.UUCP
Wed Jul 13 00:01:55 AEST 1988


In article <376 at accelerator.eng.ohio-state.edu> rob at kaa.eng.ohio-state.edu
(Rob Carriere) writes:
[re int a; ... a *= 1.05;]
>... the conversion rule says that a is to be converted to double; this
>seems to contradict the idea that a is to be computed *once*.

Right idea, wrong expansion: a's *address* (if it has one) is to be
computed once.  (a itself is indeed computed only once: if a is 800 it
is computed/evaluated as 800.  That value, now in a temporary
somewhere, is converted to double, multipled, and stored back in a's
address.)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.std.c mailing list