I'm trying to find a function. And although it seems to be very simple at first I can't figure it out. Maybe I just need some sleep, and maybe someone could help me out.
given an Integer x between 0 and 100: if x is between 0-10 then f(x)=0 if x is between 11-20 then f(x)=11 if x is between 21-30 then f(x)=21 if x is between 31-40 then f(x)=31 ... if x is between 91-100 f(x)=91
I'm trying to find the simplest f possible.
The best I could do is:
f(x) = x / 10 * 10
But it's not right.
What function is f?
EDIT
I'm accepting @Didier's solution but I'm going with this one instead.
$f(x) = \begin{cases} 1+10\lfloor (x-1)/10 \rfloor & \mbox{if } x >10; \\ 0 & \mbox{if } x \leq 10 \end{cases}$