why does `x % 1`

return the same value as `abs(x) - abs(int(x))`

?

I don't understand how x % 1 is evaluated...

I came up with the abs(x) - abs(int(x)) method while doing the is_int() exercise in the Python practice makes perfect lesson, but found that someone used the x%1 method which looks a lot cleaner to me and I'd like to understand how it works.

thanks!