Given $\lceil x−1 \rceil$, how can I compute $\lfloor x \rfloor$ without using $modulo$?

161 Views Asked by At

I have $\lceil x \rceil = -\lfloor -x \rfloor$, but I can't figure out how to rely on this in order to get $\lfloor x \rfloor$ from $\lceil x−1 \rceil$.

For the record, I am only interested in non-negative real values.

I wish to avoid the use of $modulo$, $abs$, $round$ and $if$.

The motivation behind this question is as follows:

$$x-\frac{1}{2}-\frac{\arctan(\tan(\pi(x-\frac{1}{2})))}{\pi}=\lceil x-1 \rceil$$

How do I "manipulate" the value of $x$ in order to get $\lfloor x \rfloor$ instead of $\lceil x-1 \rceil$?

UPDATE:

I also have this if it helps:

$$x+\frac{1}{2}+\frac{\arctan(\tan(\pi(-x-\frac{1}{2})))}{\pi}=\lceil x \rceil$$

2

There are 2 best solutions below

2
On

If $x\in\mathbb N$, $\lceil x-1 \rceil = x-1 = \lfloor x \rfloor - 1$, else $\lceil x-1\rceil = \lfloor x \rfloor$. Without additional information, this is impossible.

8
On

You know that $\lfloor x\rfloor=-\lceil-x\rceil$, so if you replace $x$ by $-x$ and multiply the equation by $-1$, you get $$x-\frac{1}{2}-\frac{\arctan(\tan(\pi(x-\frac{1}{2})))}{\pi}=-\lceil -x \rceil=\lfloor x\rfloor$$