On 1/22/26 09:12, Ilya Leoshkevich wrote:
+static bool float128_is_int(float128 x)
+{
+ return extract64(x.high, 0, 48) == 0 && x.low == 0;
+}
This isn't testing for integer, it's testing for 1.0eNN,
i.e. a power of two.
+ /* Compute precise quotient */
\
+ a128 = floatN ## _to_float128(a, &env->fpu_status);
\
+ b128 = floatN ## _to_float128(b, &env->fpu_status);
\
+ q128 = float128_div(a128, b128, &env->fpu_status);
\
+
\
+ /* Final or partial case? */
\
+ is_q128_smallish = float128_get_exp(q128) < p;
\
+ is_final = is_q128_smallish || float128_is_int(q128);
\
The language from the manual,
# If the precise quotient is not an integer and the two
# integers closest to this precise quotient cannot both
# be represented exactly in the precision of the quotient ...
does not appear to be what you are computing here.
Certainly none of this relates to "precision of the quotient".
I would imagine that all of this would be easier to accomplish if you did this in fpu/
with FloatParts instead of continually swapping in and out of float128.
r~