O
Oliver Wong
From the JLS 3rd edition:
http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.26
<quote>
a=b=c means a=(b=c), which assigns the value of c to b and then assigns the
value of b to a.
</quote>
I'm inferring that if "a" and "c" are double precision floating points,
and "b" is a single precision floating point, then the assignment from "c"
to "b" may result in some rounding, and the assignment to "a" will give "a"
the rounded value in "b", and not the original value from "c".
However, a friend of mine said when they disassembled the code produced
by javac essentially says "read c; duplicate; write b; write a;" which seems
to contradict what the JLS claims.
I'm at work right now, and I don't have easy access to a class file
disassembler, so I was wondering if someone could verify whether JavaC and
the JLS really do contradict each other for me.
- Oliver
http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.26
<quote>
a=b=c means a=(b=c), which assigns the value of c to b and then assigns the
value of b to a.
</quote>
I'm inferring that if "a" and "c" are double precision floating points,
and "b" is a single precision floating point, then the assignment from "c"
to "b" may result in some rounding, and the assignment to "a" will give "a"
the rounded value in "b", and not the original value from "c".
However, a friend of mine said when they disassembled the code produced
by javac essentially says "read c; duplicate; write b; write a;" which seems
to contradict what the JLS claims.
I'm at work right now, and I don't have easy access to a class file
disassembler, so I was wondering if someone could verify whether JavaC and
the JLS really do contradict each other for me.
- Oliver