Computations in floats instead of integers to avoid precision loss. Fix #20