Yesterday, nobody contributed anything. :-( The official answer is: 2 * x + abs(floor(2 * x)).