Ok, I'm encountering this weird result when performing:
l = [2, 5, 2, 6, 7, 3, 7, 5, 7, 0, 6, 10]
r = median(l)
The r becomes 11/2 which is 5.5. The median here is clearly an integer and it is 5!
Why does it return 5.5?
| 1 | initial version |
Ok, I'm encountering this weird result when performing:
l = [2, 5, 2, 6, 7, 3, 7, 5, 7, 0, 6, 10]
r = median(l)
The r becomes 11/2 which is 5.5. The median here is clearly an integer and it is 5!
Why does it return 5.5?
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.