From: | henry@spsystems.net (Henry Spencer) |
Newsgroups: | comp.compilers |
Date: | 17 Jan 2006 21:40:30 -0500 |
Organization: | SP Systems, Toronto, Canada |
References: | 06-01-037 |
Keywords: | analysis |
Posted-Date: | 17 Jan 2006 21:40:30 EST |
Oliver Wong <owong@castortech.com> wrote:
>z = y = x;
>
> Which of the following outputs would be more "correct"?
There is no single generic right answer. Does the value of x get stored
to y and z, or does the value of x get stored to y, and then the new value
of y get stored to z? It depends on the language! (And I don't remember
just what Java says about it.) When type conversions are involved, the
two are not semantically equivalent -- for example, if x and z are
double-precision floating-point variables and y is single-precision, the
value of z depends on how the assignments are done.
--
spsystems.net is temporarily off the air; | Henry Spencer
mail to henry at zoo.utoronto.ca instead. | henry@spsystems.net
Return to the
comp.compilers page.
Search the
comp.compilers archives again.