import sys
from math import floor

def wrap_fractional_modulo(v):
    return v % 1.0

def wrap_fractional_floor(v):
    return v - floor(v)

def wrap_fractional_int(v):
    return v - int(v)

def show_wrap_fractional(v):
    print()
    print(f"{v} - int({v})  =", wrap_fractional_int(v))
    print(f"{v} % 1.0        =", wrap_fractional_modulo(v))
    print(f"{v} - floor({v})=", wrap_fractional_floor(v))
    
print()
print("Check how float values are wrapped to [0, 1) or not")

show_wrap_fractional(2.2)
show_wrap_fractional(1.2)
show_wrap_fractional(0.2)
show_wrap_fractional(-0.2)
show_wrap_fractional(-1.2)
show_wrap_fractional(-2.2)