Overclock.net - An Overclocking Community - View Single Post - Why is this correct? Looks to me like it shouldn't work.

View Single Post
post #3 of (permalink) Old 10-23-2017, 06:28 PM - Thread Starter
PhotonFanatic
New to Overclock.net
 
PhotonFanatic's Avatar
 
Join Date: Dec 2009
Posts: 1,878
Rep: 19 (Unique: 18)
I just can't see how its applying the order of operations to this. Probably because I'm used to all my math being splayed out on paper so that I can follow along with relative ease. How is that still following order of operations? The way it looks to me, I never laid out a problem for it that would result in the order of operations even being used.

The way you wrote it out:

meal = 44.50 + 44.50 * 0.0675
meal = 44.50 + 3.00375
meal = 47.50375


Looks to me like it would be ok because the meal variable is being reassigned at the end. I learned that it doesn't care if you change it later, and it will just use the latest definition. So if I said:

meal = $1

and then on the next line I said:

meal = $2

It would forever just use $2 for meal instead of $1.

"Executing execution.exe"
Bang for the buck
(12 items)
CPU
3570k @ 4.6Ghz @1.35v
Motherboard
Gigabyte Z77x UD3H
GPU
evga GTX 970 SSC
RAM
16Gb Gskill Ripjaws 2133Mhz @ 9-11-10-28
Hard Drive
Samsung Evo 850
Power Supply
Silverstone 900 watt
Cooling
Thermalright Ultra 120 Extreme
Case
Silverstone Raven (1st edition)
Operating System
Windows 10 Spy Delux
Monitor
Xstar 27" PLS 1440p
Keyboard
Wireless ergonomic
Mouse
Logisys Wireless trackball
▲ hide details ▲
PhotonFanatic is offline