fix median calculation for odd size sets

Median calculation was sometimes incorrect for odd size arrays due to Ruby flooring odd integers when dividing them by two