View Single Post
  #10 (permalink)  
Old 09-08-2004, 01:27 PM
accwai's Avatar
accwai accwai is offline
Enthusiast
 
Real Name: Andy Wai
Location: Toronto, Canada
Hybrids: 2004 Prius
Posts: 47
Default

Quote:
Originally posted by Jason@Sep 8th 2004 @ 1:36 PM
Unless I'm mistaken, what you've written is the same thing as what I have right now.

Current: [ SUM-of-all(tankmileage*tankdistance) ] / totaldistance
Yours: totaldistance / [ SUM-of-all(tankmileage/tankdistance) ]
Actually mine is totaldistance / [SUM-of-all(tankdistance/tankmileage)]. Of course, the nice thing about this is that the number of major math operations in both are the same. Therefore, the new formula should have no significant effect on your server performance.

Now if we plug in the numbers from our previous example, the current comes out to (50*100+20*50)/(100+50) = 6000/150 = 40mpg. Mine is (100+50)/(100/50+50/20) = 150/(2+2.5) = 150/4.5 = 33.3mpg. So they are not the same. Remember, to disprove a theory, one counterexample is enough

Andy
Reply With Quote