# Fractional part

In the previous post I talked about the floor and ceiling functions. Go check them out if you haven’t already! We are going to need them to learn about the fractional part.

What is fractional part?

The fractional part of a positive number is the part after the decimal, i.e. the decimal part. We can write the fractional part of a number x as

$\text{frac}(x)&space;\text{&space;or&space;}\left&space;\{&space;x&space;\right&space;\}$

Here are some examples:

$\left&space;\{&space;2.6&space;\right&space;\}=0.6$ $\left&space;\{&space;4.8&space;\right&space;\}=0.8$ $\left&space;\{&space;7.5&space;\right&space;\}=0.5$ $\left&space;\{&space;3&space;\right&space;\}=0$

If you noticed, the fractional part of 2.6 is 0.6, which is 2.6-2, and the same happens for the other examples. This means that the result is the input – the integer part, and, as we saw in the previous post, the integer part of a real number is given by the floor function.

For real numbers, the fractional part can be defined as

$\left&space;\{&space;x&space;\right&space;\}=x-\left&space;\lfloor&space;x&space;\right&space;\rfloor$

And for the first example we have:

$\left&space;\{&space;2.6&space;\right&space;\}=2.6-\left&space;\lfloor&space;2.6&space;\right&space;\rfloor=2.6-2=0.6$

Another definition I figured out playing around with numbers makes use of the ceiling function.

$\left&space;\{&space;x&space;\right&space;\}=\left&space;|&space;-x-\left&space;\lceil&space;-x&space;\right&space;\rceil&space;\right&space;|=x+\left&space;\lceil&space;-x&space;\right&space;\rceil$

Let’s try it out!

$\left&space;\{&space;2.6&space;\right&space;\}=2.6+\left&space;\lceil&space;-(2.6)&space;\right&space;\rceil=2.6+(-2)=2.6-2=0.6$

These two definitions can be used to know what the fractional part of a negative number is:

$\left&space;\{&space;-4.8&space;\right&space;\}=-4.8-\left&space;\lfloor&space;-4.8&space;\right&space;\rfloor=-4.8-(-5)=-4.8+5=0.2$ $\left&space;\{&space;-4.8&space;\right&space;\}=-4.8+\left&space;\lceil&space;-(-4.8)&space;\right&space;\rceil=-4.8+\left&space;\lceil&space;4.8&space;\right&space;\rceil=-4.8+5=0.2$

The result you would expect from {-4.8} is probably -0.8 or 0.8, but we’ve just seen that it is actually 0.2, which is 1-0.8. This means that we can also write the fractional part of a negative number as

$\left&space;\{&space;x&space;\right&space;\}=1-\left&space;\{&space;\left&space;|&space;x&space;\right&space;|&space;\right&space;\}$ $\left&space;\{&space;-4.8&space;\right&space;\}=1-\left&space;\{&space;\left&space;|&space;-4.8&space;\right&space;|&space;\right&space;\}=1-\left&space;\{&space;4.8&space;\right&space;\}=1-0.8=0.2$

Keep in mind that I am showing you these other ways to write {x} for the sake of curiosity. The only definition you must remember is the first one.

A few more examples:

$\left&space;\{&space;-7.13&space;\right&space;\}=0.87$ $\left&space;\{&space;-15.79&space;\right&space;\}=0.21$ $\left&space;\{&space;-9.3\bar{5}&space;\right&space;\}=0.6\bar{4}$

What if you want to know the fractional part of a fraction? A fraction is a division after all, so just write the result and then take the fractional part of it.

$\left&space;\{&space;\frac{13}{8}\right&space;\}=\left&space;\{&space;1.625&space;\right&space;\}=0.625$ $\left&space;\{&space;\frac{7}{6}\right&space;\}=\left&space;\{&space;1.1\bar{6}&space;\right&space;\}=0.8\bar{3}$ $\left&space;\{&space;\frac{19}{7}\right&space;\}=\left&space;\{&space;2.71428...&space;\right&space;\}=0.71428...$

And that’s all! I hope you liked this post and if something is not clear let me know in the comments!

Join 30 other subscribers.

Support my site!

I put all of my efforts to make this site as good as possible. If you would like, you can help my site grow with a small donation! I would really appreciate it.

\$1.00