コミットメタ情報

リビジョンaea5438abb1dccee588872e16b4569a0be8900f4 (tree)
日時2018-10-13 03:33:25
作者Agustina Arzille <avarzille@rise...>
コミッターAgustina Arzille

ログメッセージ

Refactor name

変更サマリ

差分

diff -r f26ceb9b4dbe -r aea5438abb1d floatp.cpp
--- a/floatp.cpp Fri Oct 12 15:29:15 2018 -0300
+++ b/floatp.cpp Fri Oct 12 15:33:25 2018 -0300
@@ -370,7 +370,7 @@
370370 }
371371
372372 static int
373-write_flt (interpreter *interp, stream *strm, double ldbl,
373+write_flt (interpreter *interp, stream *strm, double dbl,
374374 int width, int prec, int flags, int radix)
375375 {
376376 uint32_t space[(DBL_MANT_DIG + 28) / 29 + 1 +
@@ -382,8 +382,8 @@
382382 char *ebuf = ebuf_st + sizeof (ebuf_st), *estr;
383383 const char *prefix = "-0X+0X 0X-0x+0x 0x";
384384
385- if (ldbl < 0)
386- ldbl = -ldbl;
385+ if (dbl < 0)
386+ dbl = -dbl;
387387 else if (flags & io_info::FLG_SIGN)
388388 prefix += 3;
389389 else if (flags & io_info::FLG_SPACE)
@@ -391,17 +391,17 @@
391391 else
392392 px = 0, ++prefix;
393393
394- ldbl = frexpl (ldbl, &e2);
394+ dbl = frexpl (dbl, &e2);
395395
396396 if (radix == 16)
397397 { // Hex-float.
398398 int convdig = (flags & io_info::FLG_UPPER) ? 'A' : 'a';
399- if ((ldbl += ldbl) != 0)
399+ if ((dbl += dbl) != 0)
400400 --e2;
401401
402402 if (prec != 0 && prec < (int)((DBL_DIG + 1) * .831) + 1)
403403 { // Round the mantissa.
404- double tail = ldbl;
404+ double tail = dbl;
405405 int q;
406406
407407 for (q = prec ; ; --q)
@@ -426,7 +426,7 @@
426426 for (q = prec; q > 0; --q)
427427 tail *= 0.0625;
428428
429- ldbl += tail;
429+ dbl += tail;
430430 }
431431
432432 ix = 0; // Return value.
@@ -437,22 +437,22 @@
437437 ix += strm->putb (interp, '0');
438438 ix += strm->putb (interp, convdig - 'A' + 'X');
439439
440- int digit = (int)ldbl;
441- ldbl -= digit;
440+ int digit = (int)dbl;
441+ dbl -= digit;
442442
443443 ix += strm->putb (interp, '0' + digit);
444444
445- if ((flags & io_info::FLG_ALT) || ldbl > 0 || prec > 0)
445+ if ((flags & io_info::FLG_ALT) || dbl > 0 || prec > 0)
446446 {
447447 ix += strm->putb (interp, '.'); // XXX: Localization.
448448
449449 /* The following loop must terminate, based on the above
450450 * assertion that FLT_RADIX is a power of 2. */
451- for (; ldbl > 0; --prec)
451+ for (; dbl > 0; --prec)
452452 {
453- ldbl *= 16.;
454- digit = (int)ldbl;
455- ldbl -= digit;
453+ dbl *= 16.;
454+ digit = (int)dbl;
455+ dbl -= digit;
456456
457457 ix += strm->putb (interp, digit < 0 ?
458458 '0' : convdig - 10 + digit);
@@ -470,9 +470,9 @@
470470 return (ix);
471471 }
472472
473- if ((ldbl += ldbl) != 0)
473+ if ((dbl += dbl) != 0)
474474 {
475- ldbl *= 0x1p28;
475+ dbl *= 0x1p28;
476476 e2 -= 29;
477477 }
478478
@@ -488,10 +488,10 @@
488488
489489 do
490490 {
491- *zp = (uint32_t)ldbl;
492- ldbl = 1000000000 * (ldbl - *zp++);
491+ *zp = (uint32_t)dbl;
492+ dbl = 1000000000 * (dbl - *zp++);
493493 }
494- while (ldbl != 0);
494+ while (dbl != 0);
495495
496496 while (e2 > 0)
497497 {
旧リポジトリブラウザで表示