Mark H Weaver <m...@netris.org> skribis:

>> What was the rationale for ‘round-ash’?
>
> Well, we need it internally to efficiently convert large integers to
> floating-point with proper rounding (see the call to
> 'round_right_shift_exact_integer' in patch 5).  Given that, it seemed
> reasonable to export it to the user, since it's not possible to do that
> job efficiently with our current primitives.  However, I don't feel
> strongly about it.

OK, the rationale makes sense to me.

>> It seems to address to do two things differently from ‘ash’: it’s more
>> efficient, and it rounds when right-shifting.  The “more efficient” bit
>> is an implementation detail that should also benefit to ‘ash’ (as a user
>> I don’t want to have to choose between efficient and non-rounding.)
>
> No, 'round-ash' is not more efficient than 'ash'.  It's more efficient
> than the equivalent (round (* n (expt 2 count))).

I see.  I misunderstood the documentation’s reference to efficiency.

Thanks,
Ludo’.

Reply via email to