# About fractional parts and floor functions...

#### DreamWeaver

##### Well-known member
Hi all! I wasn't really sure where to post this, but Analysis seemed a fair bet.

While searching on-line recently, I came across the following expressions for the Fractional Part $$\displaystyle \{x\}$$ and Floor Function $$\displaystyle \lfloor x \rfloor$$ respectively:

$$\displaystyle \{x\}=\frac{i\log\left(-e^{-2\pi i x}\right)}{2\pi}+\frac{1}{2}$$

$$\displaystyle \lfloor x \rfloor=x-\frac{i\log\left(-e^{-2\pi i x}\right)}{2\pi}-\frac{1}{2}$$

I can't remember where I found them, but just made a note of them... I seem to recall that a condition of both of the above was that the principal branch of the complex logarithm must be taken.

And so, finally, the question: can any of you shed intuitive light on the above? I've been trying to divine some sense out of those expressions, but sadly for me, I'm not Euler...   All the best, and thanks in advance! Gethin

#### Klaas van Aarsen

##### MHB Seeker
Staff member
The imaginary argument of the exponential function has a period of $2 \pi$, just like the sine and the cosine. That means that:
$$e^{2\pi i x} = e^{2\pi i (\lfloor x \rfloor + \{x\})} = e^{2\pi i \{x\}}$$

The log function of this expression is:
$$\log(e^{2\pi i x}) = i (2\pi x \text{ mod }{2\pi}) = i (2\pi \{x\} \text{ mod }{2\pi})$$

The principal branch is:
$$\text{Log}(e^{2\pi i x}) = 2\pi i \{x\}$$

#### DreamWeaver

##### Well-known member
The imaginary argument of the exponential function has a period of $2 \pi$, just like the sine and the cosine. That means that:
$$e^{2\pi i x} = e^{2\pi i (\lfloor x \rfloor + \{x\})} = e^{2\pi i \{x\}}$$

The log function of this expression is:
$$\log(e^{2\pi i x}) = i (2\pi x \text{ mod }{2\pi}) = i (2\pi \{x\} \text{ mod }{2\pi})$$

The principal branch is:
$$\text{Log}(e^{2\pi i x}) = 2\pi i \{x\}$$

Doh!!! But of course.... Thank you!!! 