[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mpf: x / x != 1

From: Kevin Ryde
Subject: Re: mpf: x / x != 1
Date: 03 Jul 2001 09:33:11 +1000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.5

Peter Moulder <address@hidden> writes:
> To me, the above suggests that x / x should always result in 1 (for
> non-zero x), and that a comparison with 1 (using mpf_cmp etc.) would
> return 0.

That'd be the hope.

> The below program shows that this is not so for x = a tiny
> bit less than 40.

Thanks, that's not good.

> I'd also suggest adding to mpf/tests something like the program I
> sent in the previous message, so that the bug doesn't re-appear when
> someone decides to do "optimization".


> +  /* The `+ 1' below is to allow for a non-zero count of leading zeros, in
> +     which case the shifted-in bits need to be from v instead of zeros. */

Thanks, sounds plausible.

At some point in the future mpf_div (and the similar mpf_set_q) will
probably switch to mpn_tdiv_qr, which will mean it won't have to do
its own normalization.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]