First part of conversion to use decimal numbers in place of double numbers - fix rounding errors from binary floats