That is how a median is defined, not the mean.