Prev: Business Calendar
Next: Reading from very large file
From: EJP on 11 May 2010 03:26 Sorry ignore previous posted in error.
From: Lew on 11 May 2010 13:53 Lew wrote: >> The operands in the expression >> >> a + b * c / f >> >> are evaluated left to right. EJP wrote: > There's nothing in the JLS that actually says that. It says in effect > the operands *of an operator* are evaluated left-to-right. Of course it says that, in the quote I cited upthread (s. 15.7.1): "The left-hand operand of a binary operator appears to be fully evaluated before any part of the right-hand operand is evaluated." 'a' appears to be fully evaluated before '(b * c / f)'. 'b' before '(c / f)'. 'c' before 'f'. Hence 'a' before 'b' before 'c' before 'f'. -- Lew
From: EJP on 12 May 2010 04:17
Sorry, agreed. I was recently dealing with a claim that all operands are evaluated left to right before any operators, and I'm still touchy about it ;-) |