On 1/29/26 00:19, Ilya Leoshkevich wrote:
With some testcases I hit this condition in parts_round_to_int_normal():

     if (a->exp >= frac_size) {
         /* All integral */
         return false;
     }

which makes it a no-op.

I think the code assumes that FloatParts have just been unpacked and all low fraction bits are zero, which is not the case for quotient here.

+        float_exception_flags = saved_flags;
+        parts_s390_precision_round_normal(&n128, fmt);

parts_round_to_int_normal already takes a rounding mode and frac_size.
It also returns whether or not the rounding was exact.
This appears to be trying to reinvent the wheel.


Apparently I use this to paper over the above issue, which is not great.

I guess improving parts_round_to_int() to work with non-zero low fraction bits would be better.

What do you think?

Yes indeed.  I think (a->exp >= N) should be sufficient?


r~

Reply via email to