JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat  | Threaded  | Tree
Previous Thread  |  Next Thread
Order of Operations | Reply
As an example, the expression x + y - z may once be evaluated as x + (y - z) and the other time as (x + y) - z. Try substituting the values x = 1.0 and y = z = 1030.

I would be very wary of doing any math in a language that doesn't enforce order of operations. While it's true that addition and subtraction have equal precedence, order is then supposed to go from left to right. If a compiler feels free to reorder the operands, then the compiler is broken.
Subject Author Date
Order of Operations sbeitzel Jan 17, 2006 at 6:04 PM EST
Re: Order of Operations hagman Feb 9, 2006 at 5:21 PM EST
RSS