Use the ceil and floor alternatively
if ( flip ^= true ) document . write ( parseInt ( ( Math . ceil ( arr [ i ] / 2.0 ) ) ) + " " ) ; else document . write ( parseInt ( ( Math . floor ( arr [ i ] / 2.0 ) ) ) + " " ) ; }