Gregory Stark <[EMAIL PROTECTED]> writes:
> "Tom Lane" <[EMAIL PROTECTED]> writes:
>> Yeah, my proposed patch is schoolbook division.  I don't think I'd trust
>> Newton's method to give anything but a close approximation, which is
>> what we have in HEAD already.

> Well unless we start storing rational numbers it'll always be a limited to a
> finite number of decimals. The key is whether we can guarantee a lower bound
> on the number of accurate decimal places. As long as we can then we can keep
> going until the decimal places we're going to return are all accurate.

This is nonsense.  Consider an approximate division that gives


You can keep generating 9's forever, but you'll never know whether the
accurate result of trunc() should be 123 or 124.  Unless you use a
method that gives you trustworthy digits to start with.

> It looks like multiplication can also generate incorrect results.

It can, but only if told to produce fewer digits than would be in the
exact result, so I'm not worried about that.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?


Reply via email to