>>562shift right 9, add 1, shift right 1...it's slightly faster than doing int($size/1024+.5) (about .25 seconds of cpu time for 1000000 iterations on my machine), and, at least to me, a more straightforward way to do it...
int($size/1024+.5)