1 // cl_F_shortenrelative().
15 const cl_F cl_F_shortenrelative (const cl_F& x, const cl_F& y)
18 // x = 0.0 -> Precision egal, return x.
19 // ex := float_exponent(x), ey := float_exponent(y).
20 // dx := float_digits(x), dy := float_digits(y).
21 // 1 ulp(x) = 2^(ex-dx), 1 ulp(y) = 2^(ey-dy).
22 // Falls ex-dx < ey-dy, x von Precision dx auf dy-ey+ex verkürzen.
23 var sintL ey = float_exponent(y);
24 var sintL dy = float_precision(y);
25 if (dy==0) // zerop(y) ?
27 var sintL ex = float_exponent(x);
28 var sintL dx = float_precision(x);
29 if (dx==0) // zerop(x) ?
31 var sintL d = ex - ey;
32 if (ex>=0 && ey<0 && d<0) // d overflow?
34 if (ex<0 && ey>=0 && d>=0) // d underflow?
38 var uintL new_dx = dy + d;
39 floatformatcase(new_dx
40 , return cl_F_to_SF(x);
41 , return cl_F_to_FF(x);
42 , return cl_F_to_DF(x);
43 , if (intDsize*len < (uintL)dx)
44 return shorten(The(cl_LF)(x),len);