On Tue, 2 Jul 2024 at 11:23, Joel Jacobson <joel@compiler.org> wrote:
>
> Just to be able to verify mul_var() is working as expected when
> rscale is less than the full result, I've added a numeric_mul_patched()
> function that takes a third rscale_adjustment parameter:
Yeah, we could expose such a function, and maybe it would be generally
useful, not just for testing, but that's really a separate proposal.
In general, mul_var() with reduced rscale doesn't guarantee correctly
rounded results though, which might make it less generally acceptable.
For this patch though, the aim is just to ensure the results are the
same as before.
> I've tried to get a different result with and without the fix,
> but I'm failing to hit the bug.
>
> Can you think of an example that should trigger the bug?
9999.0001 * 5000.9999_9999 with rscale = 0 triggers it (returned
50004999 instead of 50005000).
Regards,
Dean