|
From: Raymond T. <toy...@gm...> - 2016-03-30 19:56:08
|
>>>>> "Robert" == Robert Dodier <rob...@gm...> writes:
Robert> On 2016-03-30, Raymond Toy <toy...@gm...> wrote:
>> It seems to me the only way to make it exact is to convert all floats
>> to the corresponding rational number.
Robert> It doesn't require converting to rationals. The tricky part is computing
Robert> floor(x/y) since x/y might be rounded up to an integer. But it's easy to
Robert> detect that -- if x < floor(x/y)*y then x/y was rounded up. In that case
There's an additional rounding from computing floor(x/y)*y, since y is
floating point. Without further analysis, I don't know if that would
affect the comparison.
--
Ray
|