[PATCH 8/9] i386: Move hypot implementation to C
Paul Zimmermann
Paul.Zimmermann@inria.fr
Thu Oct 7 08:28:43 GMT 2021
> > In fact we need to handle underflow:
> >
> > long double lx = x;
> > long double ly = y;
> > double r = sqrtl (lx * lx + ly * ly);
>
> You probably also need a math_narrow_eval here to ensure the value checked
> for overflow and returned has definitely been properly narrowed to double
> first.
right, If x = y = 0x1.fffffffffffffp1023, then lx * lx + ly * ly will not
overflow as long double, nor sqrtl(.), but the conversion to double will.
This should probably be added as a test case (if not already).
Paul
More information about the Libc-alpha
mailing list