Forum Discussion
List Generate Average as record;
- 8 months ago
I'm not sure what you are asking here.
Clearly in the code z and y are always the same.
But what is this? It makes no sense. Where are you getting this from?
z / 2 <> z = y/2
You can't say a thing (z/2) is not equal (or equal) to another thing (z=y/2).
You can't have an assignment on one side of a logical test like this
Again not sure how esle to explain this other than how I have.
z / 2 <> z = y/2 makes no sense mathematically and I don't know what you are trying to do there.
Phil
ok but you state ; Your avg = ([Prev Avg] 2 .5 + 3 ) / 3 = 1.83333 ,
but if you don't do the divsion it's the correct result example
I'm not sure what you mean when you say if you don't do the division it's the correct result ?
If you don't divide the sum by anything how do you get an average? And how can it be correct?
For the way you are calculating the average if you don't do any division you get a sum of 2.5 + 3 = 5.5. Then what?
The correct sum when x = 3 is 2 + 3 + 4 = 9, not 5.5.
Sorry I'm not sure how else to explain this. If you follow my example I'd have thought that woud make it clear. Maybe try doing my example on paper as working through something by hand can often help understanding rather than reading code and math.
Phil