import sys

eps = 1.0e-10

argv = sys.argv
if len(argv) >= 2:
    h = float(argv[1])
if len(argv) >= 3:
    n = int(argv[2])

def compare(h, n, eps):
    v = 0.0
    i = 0
    while i < n:
        v = v + h
        i = i + 1
    
    print()
    print(f"Summing up {h} for {n} times: v = {v:.17f}")
    print("int(v)       =", int(v))
    print("int(v + eps) =", int(v + eps))
    print("int(round(v))=", int(round(v)))
    print(f"   Used {eps=}")
    print()


compare( 0.01, 100, eps)
compare(-0.01, 100, eps)
compare(-0.01, 100, -eps)

print()
print("You may expect:")
print("  int(1.0000001) = 1")
print("  int(0.0000001) = 0")
print("  int(-0.9999999)=-1")
print("  int(-1.0000001)=-1")

