Lines Matching refs:scale
296 int e0, nd, nd0, scale;
983 except that it accepts the scale parameter used in _Py_dg_strtod (which
986 / 2**scale should be exactly representable as an IEEE 754 double.
990 dval(d) / 2**scale = b * 2**e.
998 2**e gives ulp(d/2**scale).
1004 sd2b(U *d, int scale, int *e)
1012 /* First construct b and e assuming that scale == 0. */
1022 /* Now adjust for scale, provided that b != 0. */
1023 if (scale && (b->x[0] || b->x[1])) {
1024 *e -= scale;
1026 scale = Etiny - *e;
1029 assert(0 < scale && scale <= P - 1);
1030 if (scale >= 32) {
1035 scale -= 32;
1037 if (scale) {
1039 assert(b->x[0] << (32 - scale) == 0);
1040 b->x[0] = (b->x[0] >> scale) | (b->x[1] << (32 - scale));
1041 b->x[1] >>= scale;
1229 /* sulp(x) is a version of ulp(x) that takes bc.scale into account.
1232 here) and x / 2^bc.scale is exactly representable as a double,
1233 sulp(x) is equivalent to 2^bc.scale * ulp(x / 2^bc.scale). */
1240 if (bc->scale && 2*P + 1 > (int)((word0(x) & Exp_mask) >> Exp_shift)) {
1241 /* rv/2^bc->scale is subnormal */
1273 bc->scale is nonzero, then rv/2^(bc->scale) is the approximation to
1289 bc->scale is the value used to scale rv to avoid doing arithmetic with
1294 On successful exit, rv/2^(bc->scale) is the closest double to dv.
1307 b = sd2b(rv, bc->scale, &p2);
1311 /* record whether the lsb of rv/2^(bc->scale) is odd: in the exact halfway
1316 this gives us b * 2**p2 = rv/2^(bc->scale) + 0.5 ulp. */
1671 bc.scale = 0;
1705 If e1 <= -256, set bc.scale to 2*P.
1707 So for input value < 1e-256, bc.scale is always set;
1708 for input value >= 1e-240, bc.scale is never set.
1709 For input values in [1e-256, 1e-240), bc.scale may or may
1719 bc.scale = 2*P;
1723 if (bc.scale && (j = 2*P + 1 - ((word0(&rv) & Exp_mask)
1790 - srv for the quantity rv/2^bc.scale; so srv is the current binary
1800 srv=rv/2^bc.scale to tdv. The aim is to determine whether srv is
1815 bb = sd2b(&rv, bc.scale, &bbe); /* srv = bb * 2^bbe */
1940 /* rv / 2^bc.scale = 2^(j - 1023 - bc.scale); use bigcomp if
1941 rv / 2^bc.scale >= 2^-1021. */
1942 if (j - bc.scale >= 2) {
1980 (bc.scale &&
1996 if (bc.scale) {
2080 if (bc.scale && y <= 2*P*Exp_msk1) {
2096 if (!bc.scale)
2122 if (bc.scale) {
2216 * to determine k = floor(log10(d)). We scale relevant