aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormax99x <max99x@gmail.com>2011-06-28 03:42:53 +0300
committermax99x <max99x@gmail.com>2011-06-28 03:42:53 +0300
commit26d16fbbca1de5f13306359bf78389adc438ba6b (patch)
tree9cba65ebc841bd4d963cf23c370a4bc73051463f
parent5824029a7ccabe7f59f2015fb860cbfadc547c35 (diff)
Replaced brainded float formatting with a much cleaner (and more precise) version.
-rw-r--r--src/library.js184
-rw-r--r--tests/printf/output.txt224
2 files changed, 154 insertions, 254 deletions
diff --git a/src/library.js b/src/library.js
index a9f7c14a..54256c44 100644
--- a/src/library.js
+++ b/src/library.js
@@ -159,8 +159,7 @@ var Library = {
while(1) {
var precisionChr = {{{ makeGetValue(0, 'textIndex+1', 'i8') }}};
if (!_isdigit(precisionChr)) break;
- precision *= 10;
- precision += precisionChr - '0'.charCodeAt(0);
+ precision = precision * 10 + (precisionChr - '0'.charCodeAt(0));
textIndex++;
}
}
@@ -182,10 +181,8 @@ var Library = {
}
// Handle type specifier.
- var isNumeric = false;
if (['d', 'i', 'u', 'o', 'x', 'X', 'p'].indexOf(String.fromCharCode(next)) != -1) {
// Integer.
- var isNumeric = true;
var currArg = +getNextArg(next); // +: boolean=>int
var currAbsArg = Math.abs(currArg);
var argText;
@@ -212,12 +209,14 @@ var Library = {
argText = '0' + argText;
}
}
+
// Add sign.
if (currArg < 0) {
prefix = '-' + prefix;
} else if (flagAlwaysSigned) {
prefix = '+' + prefix;
}
+
// Add padding.
while (prefix.length + argText.length < width) {
if (flagLeftAlign) {
@@ -230,6 +229,7 @@ var Library = {
}
}
}
+
argText = prefix + argText;
argText.split('').forEach(function(chr) {
ret.push(chr.charCodeAt(0));
@@ -237,75 +237,23 @@ var Library = {
textIndex += 2;
} else if (['f', 'F', 'e', 'E', 'g', 'G'].indexOf(String.fromCharCode(next)) != -1) {
// Float.
- // To properly reproduce the C behaviour, we need to do a round trip
- // through the JS number formatter. Slow, but good for compatibility
- // and is probably not a bottleneck in typical usage scenarios.
- var isNumeric = true;
var currArg = +getNextArg(next); // +: boolean=>int
- var absArgText = String(Math.abs(currArg));
+ var argText;
- if (absArgText == 'NaN' || absArgText == 'Infinity') {
- // Special values.
- absArgText = absArgText.slice(0, 3);
- if (next > 'Z'.charCodeAt(0)) {
- absArgText = absArgText.toLowerCase();
- } else {
- absArgText = absArgText.toUpperCase();
- }
- if (currArg < 0) ret.push('-'.charCodeAt(0));
- absArgText.split('').forEach(function(chr) {
- ret.push(chr.charCodeAt(0));
- });
+ if (isNaN(currArg)) {
+ argText = 'nan';
+ } else if (!isFinite(currArg)) {
+ argText = (currArg < 0 ? '-' : '') + 'inf';
} else {
var isGeneral = false;
-
- // Split the number into whole, fraction and exponent.
- var indexOfPeriod = absArgText.indexOf('.');
- var indexOfE = absArgText.indexOf('e');
- var wholePart, fractionPart, exponentPart;
- if (indexOfE == -1) {
- if (indexOfPeriod == -1) {
- wholePart = absArgText;
- fractionPart = '';
- } else {
- wholePart = absArgText.slice(0, indexOfPeriod);
- fractionPart = absArgText.slice(indexOfPeriod + 1);
- }
- exponentPart = '';
- } else {
- if (indexOfPeriod == -1) {
- wholePart = absArgText.slice(0, indexOfE);
- fractionPart = '';
- } else {
- wholePart = absArgText.slice(0, indexOfPeriod);
- fractionPart = absArgText.slice(indexOfPeriod + 1, indexOfE);
- }
- exponentPart = absArgText.slice(indexOfE + 1);
- }
- var exponent = parseInt(exponentPart || 0, 10);
-
- // Normalize it so wholePart is one digit.
- if (wholePart == '0') {
- while (fractionPart.length && fractionPart[0] == '0') {
- exponent--;
- fractionPart = fractionPart.slice(1);
- }
- if (fractionPart) {
- exponent--;
- wholePart = fractionPart[0];
- fractionPart = fractionPart.slice(1);
- }
- } else {
- exponent += wholePart.length - 1;
- fractionPart = wholePart.slice(1) + fractionPart;
- wholePart = wholePart[0];
- }
+ var effectivePrecision = Math.min(precision, 20);
// Convert g/G to f/F or e/E, as per:
// http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html
if (next == 'g'.charCodeAt(0) || next == 'G'.charCodeAt(0)) {
isGeneral = true;
precision = precision || 1;
+ var exponent = parseInt(currArg.toExponential(effectivePrecision).split('e')[1], 10);
if (precision > exponent && exponent >= -4) {
next = ((next == 'g'.charCodeAt(0)) ? 'f' : 'F').charCodeAt(0);
precision -= exponent + 1;
@@ -313,91 +261,42 @@ var Library = {
next = ((next == 'g'.charCodeAt(0)) ? 'e' : 'E').charCodeAt(0);
precision--;
}
+ effectivePrecision = Math.min(precision, 20);
}
- var dropTrailingZeros = isGeneral && !flagAlternative;
-
- // Round or pad a fractional part given the current precision.
- var applyPrecision = function(fractionPart) {
- if (precision == 0) {
- fractionPart = '';
- } else if (fractionPart.length > precision) {
- fractionPart = fractionPart.slice(0, precision) + '.' + fractionPart[precision];
- fractionPart = Math.round(parseFloat(fractionPart)).toString(10);
- while (fractionPart.length < precision) {
- fractionPart = '0' + fractionPart;
- }
- } else if (!dropTrailingZeros) {
- while (fractionPart.length < precision) {
- fractionPart += '0';
- }
- }
- if (dropTrailingZeros) {
- while (fractionPart.length && fractionPart[fractionPart.length - 1] == '0') {
- fractionPart = fractionPart.slice(0, -1);
- }
+ if (next == 'e'.charCodeAt(0) || next == 'E'.charCodeAt(0)) {
+ argText = currArg.toExponential(effectivePrecision);
+ // Make sure the exponent has at least 2 digits.
+ if (/[eE][-+]\d$/.test(argText)) {
+ argText = argText.slice(0, -1) + '0' + argText.slice(-1);
}
- return fractionPart;
- };
-
- var parts = [];
- if (next == 'f'.charCodeAt(0) || next == 'F'.charCodeAt(0)) {
- // Fixed point.
- if (exponent) {
- // Denormalize.
- if (exponent > 0) {
- var step = Math.min(exponent, fractionPart.length);
- wholePart += fractionPart.slice(0, step);
- fractionPart = fractionPart.slice(step);
- exponent -= step;
- while (exponent-- > 0) wholePart += '0';
- } else {
- var step = Math.min(-exponent, wholePart.length);
- fractionPart = wholePart.slice(-step) + fractionPart;
- wholePart = wholePart.slice(0, -step);
- exponent += step;
- while (exponent++ < 0) fractionPart = '0' + fractionPart;
- }
- }
- if (precision == 0) {
- wholePart = Math.round(parseFloat(wholePart + '.' + fractionPart)).toString(10);
- fractionPart = '';
- }
- parts.push(wholePart || '0');
- fractionPart = applyPrecision(fractionPart);
- if (fractionPart) {
- parts.push('.');
- if (!dropTrailingZeros || parseInt(fractionPart, 10) > 0) {
- parts.push(fractionPart);
- }
- } else if (flagAlternative) {
- parts.push('.');
+ } else if (next == 'f'.charCodeAt(0) || next == 'F'.charCodeAt(0)) {
+ argText = currArg.toFixed(effectivePrecision);
+ }
+
+ var parts = argText.split('e');
+ if (isGeneral && !flagAlternative) {
+ // Discard trailing zeros and periods.
+ while (parts[0].length > 1 && (parts[0].slice(-1) == '0' || parts[0].slice(-1) == '.')) {
+ parts[0] = parts[0].slice(0, -1);
}
} else {
- // Scientific notation.
- parts.push(wholePart);
- fractionPart = applyPrecision(fractionPart);
- if (parseInt(fractionPart, 10) > 0 && precision != 0) {
- parts.push('.');
- parts.push(fractionPart);
- } else if (flagAlternative) {
- parts.push('.');
- }
- if (exponent || !isGeneral) {
- parts.push(String.fromCharCode(next));
- parts.push(exponent >= 0 ? '+' : '-');
- if (Math.abs(exponent) < 10) parts.push('0');
- parts.push(Math.abs(exponent).toString(10));
- }
+ // Make sure we have a period in alternative mode.
+ if (flagAlternative && argText.indexOf('.') == -1) parts[0] += '.';
+ // Zero pad until required precision.
+ while (precision > effectivePrecision++) parts[0] += '0';
}
+ argText = parts[0] + (parts.length > 1 ? 'e' + parts[1] : '');
+
+ // Capitalize 'E' if needed.
+ if (next == 'E'.charCodeAt(0)) argText = argText.toUpperCase();
+
// Add sign.
- if (currArg < 0) {
- parts.unshift('-');
- } else if (flagAlwaysSigned) {
- parts.unshift('+');
+ if (flagAlwaysSigned && currArg >= 0) {
+ argText = '+' + argText;
}
+
// Add padding.
- var argText = parts.join('');
while (argText.length < width) {
if (flagLeftAlign) {
argText += ' ';
@@ -409,10 +308,11 @@ var Library = {
}
}
}
- argText.split('').forEach(function(chr) {
- ret.push(chr.charCodeAt(0));
- });
}
+ if (next < 'a'.charCodeAt(0)) argText = argText.toUpperCase();
+ argText.split('').forEach(function(chr) {
+ ret.push(chr.charCodeAt(0));
+ });
textIndex += 2;
} else if (next == 's'.charCodeAt(0)) {
// String.
diff --git a/tests/printf/output.txt b/tests/printf/output.txt
index 99e91e7f..bdf9d0bc 100644
--- a/tests/printf/output.txt
+++ b/tests/printf/output.txt
@@ -1944,7 +1944,7 @@ NAN
%+.2lf : +8127.53
%+.5lf : +8127.53400
%+.10lf : +8127.5340000000
-%+.30lf : +8127.534000000000000000000000000000
+%+.30lf : +8127.533999999999650754030000000000
%+0lf : +8127.534000
%+0.lf : +8128
%+0.0lf : +8128
@@ -1952,7 +1952,7 @@ NAN
%+0.2lf : +8127.53
%+0.5lf : +8127.53400
%+0.10lf : +8127.5340000000
-%+0.30lf : +8127.534000000000000000000000000000
+%+0.30lf : +8127.533999999999650754030000000000
%+1lf : +8127.534000
%+1.lf : +8128
%+1.0lf : +8128
@@ -1960,7 +1960,7 @@ NAN
%+1.2lf : +8127.53
%+1.5lf : +8127.53400
%+1.10lf : +8127.5340000000
-%+1.30lf : +8127.534000000000000000000000000000
+%+1.30lf : +8127.533999999999650754030000000000
%+2lf : +8127.534000
%+2.lf : +8128
%+2.0lf : +8128
@@ -1968,7 +1968,7 @@ NAN
%+2.2lf : +8127.53
%+2.5lf : +8127.53400
%+2.10lf : +8127.5340000000
-%+2.30lf : +8127.534000000000000000000000000000
+%+2.30lf : +8127.533999999999650754030000000000
%+5lf : +8127.534000
%+5.lf : +8128
%+5.0lf : +8128
@@ -1976,7 +1976,7 @@ NAN
%+5.2lf : +8127.53
%+5.5lf : +8127.53400
%+5.10lf : +8127.5340000000
-%+5.30lf : +8127.534000000000000000000000000000
+%+5.30lf : +8127.533999999999650754030000000000
%+10lf : +8127.534000
%+10.lf : +8128
%+10.0lf : +8128
@@ -1984,7 +1984,7 @@ NAN
%+10.2lf : +8127.53
%+10.5lf : +8127.53400
%+10.10lf : +8127.5340000000
-%+10.30lf : +8127.534000000000000000000000000000
+%+10.30lf : +8127.533999999999650754030000000000
%+30lf : +8127.534000
%+30.lf : +8128
%+30.0lf : +8128
@@ -1992,7 +1992,7 @@ NAN
%+30.2lf : +8127.53
%+30.5lf : +8127.53400
%+30.10lf : +8127.5340000000
-%+30.30lf : +8127.534000000000000000000000000000
+%+30.30lf : +8127.533999999999650754030000000000
%-lf : 8127.534000
%-.lf : 8128
%-.0lf : 8128
@@ -2000,7 +2000,7 @@ NAN
%-.2lf : 8127.53
%-.5lf : 8127.53400
%-.10lf : 8127.5340000000
-%-.30lf : 8127.534000000000000000000000000000
+%-.30lf : 8127.533999999999650754030000000000
%-1lf : 8127.534000
%-1.lf : 8128
%-1.0lf : 8128
@@ -2008,7 +2008,7 @@ NAN
%-1.2lf : 8127.53
%-1.5lf : 8127.53400
%-1.10lf : 8127.5340000000
-%-1.30lf : 8127.534000000000000000000000000000
+%-1.30lf : 8127.533999999999650754030000000000
%-2lf : 8127.534000
%-2.lf : 8128
%-2.0lf : 8128
@@ -2016,7 +2016,7 @@ NAN
%-2.2lf : 8127.53
%-2.5lf : 8127.53400
%-2.10lf : 8127.5340000000
-%-2.30lf : 8127.534000000000000000000000000000
+%-2.30lf : 8127.533999999999650754030000000000
%-5lf : 8127.534000
%-5.lf : 8128
%-5.0lf : 8128
@@ -2024,7 +2024,7 @@ NAN
%-5.2lf : 8127.53
%-5.5lf : 8127.53400
%-5.10lf : 8127.5340000000
-%-5.30lf : 8127.534000000000000000000000000000
+%-5.30lf : 8127.533999999999650754030000000000
%-10lf : 8127.534000
%-10.lf : 8128
%-10.0lf : 8128
@@ -2032,7 +2032,7 @@ NAN
%-10.2lf : 8127.53
%-10.5lf : 8127.53400
%-10.10lf : 8127.5340000000
-%-10.30lf : 8127.534000000000000000000000000000
+%-10.30lf : 8127.533999999999650754030000000000
%-30lf : 8127.534000
%-30.lf : 8128
%-30.0lf : 8128
@@ -2040,7 +2040,7 @@ NAN
%-30.2lf : 8127.53
%-30.5lf : 8127.53400
%-30.10lf : 8127.5340000000
-%-30.30lf : 8127.534000000000000000000000000000
+%-30.30lf : 8127.533999999999650754030000000000
%#lf : 8127.534000
%#.lf : 8128.
%#.0lf : 8128.
@@ -2048,7 +2048,7 @@ NAN
%#.2lf : 8127.53
%#.5lf : 8127.53400
%#.10lf : 8127.5340000000
-%#.30lf : 8127.534000000000000000000000000000
+%#.30lf : 8127.533999999999650754030000000000
%#0lf : 8127.534000
%#0.lf : 8128.
%#0.0lf : 8128.
@@ -2056,7 +2056,7 @@ NAN
%#0.2lf : 8127.53
%#0.5lf : 8127.53400
%#0.10lf : 8127.5340000000
-%#0.30lf : 8127.534000000000000000000000000000
+%#0.30lf : 8127.533999999999650754030000000000
%#1lf : 8127.534000
%#1.lf : 8128.
%#1.0lf : 8128.
@@ -2064,7 +2064,7 @@ NAN
%#1.2lf : 8127.53
%#1.5lf : 8127.53400
%#1.10lf : 8127.5340000000
-%#1.30lf : 8127.534000000000000000000000000000
+%#1.30lf : 8127.533999999999650754030000000000
%#2lf : 8127.534000
%#2.lf : 8128.
%#2.0lf : 8128.
@@ -2072,7 +2072,7 @@ NAN
%#2.2lf : 8127.53
%#2.5lf : 8127.53400
%#2.10lf : 8127.5340000000
-%#2.30lf : 8127.534000000000000000000000000000
+%#2.30lf : 8127.533999999999650754030000000000
%#5lf : 8127.534000
%#5.lf : 8128.
%#5.0lf : 8128.
@@ -2080,7 +2080,7 @@ NAN
%#5.2lf : 8127.53
%#5.5lf : 8127.53400
%#5.10lf : 8127.5340000000
-%#5.30lf : 8127.534000000000000000000000000000
+%#5.30lf : 8127.533999999999650754030000000000
%#10lf : 8127.534000
%#10.lf : 8128.
%#10.0lf : 8128.
@@ -2088,7 +2088,7 @@ NAN
%#10.2lf : 8127.53
%#10.5lf : 8127.53400
%#10.10lf : 8127.5340000000
-%#10.30lf : 8127.534000000000000000000000000000
+%#10.30lf : 8127.533999999999650754030000000000
%#30lf : 8127.534000
%#30.lf : 8128.
%#30.0lf : 8128.
@@ -2096,7 +2096,7 @@ NAN
%#30.2lf : 8127.53
%#30.5lf : 8127.53400
%#30.10lf : 8127.5340000000
-%#30.30lf : 8127.534000000000000000000000000000
+%#30.30lf : 8127.533999999999650754030000000000
%0lf : 8127.534000
%0.lf : 8128
%0.0lf : 8128
@@ -2104,7 +2104,7 @@ NAN
%0.2lf : 8127.53
%0.5lf : 8127.53400
%0.10lf : 8127.5340000000
-%0.30lf : 8127.534000000000000000000000000000
+%0.30lf : 8127.533999999999650754030000000000
%01lf : 8127.534000
%01.lf : 8128
%01.0lf : 8128
@@ -2112,7 +2112,7 @@ NAN
%01.2lf : 8127.53
%01.5lf : 8127.53400
%01.10lf : 8127.5340000000
-%01.30lf : 8127.534000000000000000000000000000
+%01.30lf : 8127.533999999999650754030000000000
%02lf : 8127.534000
%02.lf : 8128
%02.0lf : 8128
@@ -2120,7 +2120,7 @@ NAN
%02.2lf : 8127.53
%02.5lf : 8127.53400
%02.10lf : 8127.5340000000
-%02.30lf : 8127.534000000000000000000000000000
+%02.30lf : 8127.533999999999650754030000000000
%05lf : 8127.534000
%05.lf : 08128
%05.0lf : 08128
@@ -2128,7 +2128,7 @@ NAN
%05.2lf : 8127.53
%05.5lf : 8127.53400
%05.10lf : 8127.5340000000
-%05.30lf : 8127.534000000000000000000000000000
+%05.30lf : 8127.533999999999650754030000000000
%010lf : 8127.534000
%010.lf : 0000008128
%010.0lf : 0000008128
@@ -2136,7 +2136,7 @@ NAN
%010.2lf : 0008127.53
%010.5lf : 8127.53400
%010.10lf : 8127.5340000000
-%010.30lf : 8127.534000000000000000000000000000
+%010.30lf : 8127.533999999999650754030000000000
%030lf : 00000000000000000008127.534000
%030.lf : 000000000000000000000000008128
%030.0lf : 000000000000000000000000008128
@@ -2144,7 +2144,7 @@ NAN
%030.2lf : 000000000000000000000008127.53
%030.5lf : 000000000000000000008127.53400
%030.10lf : 0000000000000008127.5340000000
-%030.30lf : 8127.534000000000000000000000000000
+%030.30lf : 8127.533999999999650754030000000000
%-+lf : +8127.534000
%-+.lf : +8128
%-+.0lf : +8128
@@ -2152,7 +2152,7 @@ NAN
%-+.2lf : +8127.53
%-+.5lf : +8127.53400
%-+.10lf : +8127.5340000000
-%-+.30lf : +8127.534000000000000000000000000000
+%-+.30lf : +8127.533999999999650754030000000000
%-+1lf : +8127.534000
%-+1.lf : +8128
%-+1.0lf : +8128
@@ -2160,7 +2160,7 @@ NAN
%-+1.2lf : +8127.53
%-+1.5lf : +8127.53400
%-+1.10lf : +8127.5340000000
-%-+1.30lf : +8127.534000000000000000000000000000
+%-+1.30lf : +8127.533999999999650754030000000000
%-+2lf : +8127.534000
%-+2.lf : +8128
%-+2.0lf : +8128
@@ -2168,7 +2168,7 @@ NAN
%-+2.2lf : +8127.53
%-+2.5lf : +8127.53400
%-+2.10lf : +8127.5340000000
-%-+2.30lf : +8127.534000000000000000000000000000
+%-+2.30lf : +8127.533999999999650754030000000000
%-+5lf : +8127.534000
%-+5.lf : +8128
%-+5.0lf : +8128
@@ -2176,7 +2176,7 @@ NAN
%-+5.2lf : +8127.53
%-+5.5lf : +8127.53400
%-+5.10lf : +8127.5340000000
-%-+5.30lf : +8127.534000000000000000000000000000
+%-+5.30lf : +8127.533999999999650754030000000000
%-+10lf : +8127.534000
%-+10.lf : +8128
%-+10.0lf : +8128
@@ -2184,7 +2184,7 @@ NAN
%-+10.2lf : +8127.53
%-+10.5lf : +8127.53400
%-+10.10lf : +8127.5340000000
-%-+10.30lf : +8127.534000000000000000000000000000
+%-+10.30lf : +8127.533999999999650754030000000000
%-+30lf : +8127.534000
%-+30.lf : +8128
%-+30.0lf : +8128
@@ -2192,7 +2192,7 @@ NAN
%-+30.2lf : +8127.53
%-+30.5lf : +8127.53400
%-+30.10lf : +8127.5340000000
-%-+30.30lf : +8127.534000000000000000000000000000
+%-+30.30lf : +8127.533999999999650754030000000000
%#+lf : +8127.534000
%#+.lf : +8128.
%#+.0lf : +8128.
@@ -2200,7 +2200,7 @@ NAN
%#+.2lf : +8127.53
%#+.5lf : +8127.53400
%#+.10lf : +8127.5340000000
-%#+.30lf : +8127.534000000000000000000000000000
+%#+.30lf : +8127.533999999999650754030000000000
%#+0lf : +8127.534000
%#+0.lf : +8128.
%#+0.0lf : +8128.
@@ -2208,7 +2208,7 @@ NAN
%#+0.2lf : +8127.53
%#+0.5lf : +8127.53400
%#+0.10lf : +8127.5340000000
-%#+0.30lf : +8127.534000000000000000000000000000
+%#+0.30lf : +8127.533999999999650754030000000000
%#+1lf : +8127.534000
%#+1.lf : +8128.
%#+1.0lf : +8128.
@@ -2216,7 +2216,7 @@ NAN
%#+1.2lf : +8127.53
%#+1.5lf : +8127.53400
%#+1.10lf : +8127.5340000000
-%#+1.30lf : +8127.534000000000000000000000000000
+%#+1.30lf : +8127.533999999999650754030000000000
%#+2lf : +8127.534000
%#+2.lf : +8128.
%#+2.0lf : +8128.
@@ -2224,7 +2224,7 @@ NAN
%#+2.2lf : +8127.53
%#+2.5lf : +8127.53400
%#+2.10lf : +8127.5340000000
-%#+2.30lf : +8127.534000000000000000000000000000
+%#+2.30lf : +8127.533999999999650754030000000000
%#+5lf : +8127.534000
%#+5.lf : +8128.
%#+5.0lf : +8128.
@@ -2232,7 +2232,7 @@ NAN
%#+5.2lf : +8127.53
%#+5.5lf : +8127.53400
%#+5.10lf : +8127.5340000000
-%#+5.30lf : +8127.534000000000000000000000000000
+%#+5.30lf : +8127.533999999999650754030000000000
%#+10lf : +8127.534000
%#+10.lf : +8128.
%#+10.0lf : +8128.
@@ -2240,7 +2240,7 @@ NAN
%#+10.2lf : +8127.53
%#+10.5lf : +8127.53400
%#+10.10lf : +8127.5340000000
-%#+10.30lf : +8127.534000000000000000000000000000
+%#+10.30lf : +8127.533999999999650754030000000000
%#+30lf : +8127.534000
%#+30.lf : +8128.
%#+30.0lf : +8128.
@@ -2248,7 +2248,7 @@ NAN
%#+30.2lf : +8127.53
%#+30.5lf : +8127.53400
%#+30.10lf : +8127.5340000000
-%#+30.30lf : +8127.534000000000000000000000000000
+%#+30.30lf : +8127.533999999999650754030000000000
%+0lf : +8127.534000
%+0.lf : +8128
%+0.0lf : +8128
@@ -2256,7 +2256,7 @@ NAN
%+0.2lf : +8127.53
%+0.5lf : +8127.53400
%+0.10lf : +8127.5340000000
-%+0.30lf : +8127.534000000000000000000000000000
+%+0.30lf : +8127.533999999999650754030000000000
%+01lf : +8127.534000
%+01.lf : +8128
%+01.0lf : +8128
@@ -2264,7 +2264,7 @@ NAN
%+01.2lf : +8127.53
%+01.5lf : +8127.53400
%+01.10lf : +8127.5340000000
-%+01.30lf : +8127.534000000000000000000000000000
+%+01.30lf : +8127.533999999999650754030000000000
%+02lf : +8127.534000
%+02.lf : +8128
%+02.0lf : +8128
@@ -2272,7 +2272,7 @@ NAN
%+02.2lf : +8127.53
%+02.5lf : +8127.53400
%+02.10lf : +8127.5340000000
-%+02.30lf : +8127.534000000000000000000000000000
+%+02.30lf : +8127.533999999999650754030000000000
%+05lf : +8127.534000
%+05.lf : +8128
%+05.0lf : +8128
@@ -2280,7 +2280,7 @@ NAN
%+05.2lf : +8127.53
%+05.5lf : +8127.53400
%+05.10lf : +8127.5340000000
-%+05.30lf : +8127.534000000000000000000000000000
+%+05.30lf : +8127.533999999999650754030000000000
%+010lf : +8127.534000
%+010.lf : +000008128
%+010.0lf : +000008128
@@ -2288,7 +2288,7 @@ NAN
%+010.2lf : +008127.53
%+010.5lf : +8127.53400
%+010.10lf : +8127.5340000000
-%+010.30lf : +8127.534000000000000000000000000000
+%+010.30lf : +8127.533999999999650754030000000000
%+030lf : +0000000000000000008127.534000
%+030.lf : +00000000000000000000000008128
%+030.0lf : +00000000000000000000000008128
@@ -2296,7 +2296,7 @@ NAN
%+030.2lf : +00000000000000000000008127.53
%+030.5lf : +00000000000000000008127.53400
%+030.10lf : +000000000000008127.5340000000
-%+030.30lf : +8127.534000000000000000000000000000
+%+030.30lf : +8127.533999999999650754030000000000
%+-lf : +8127.534000
%+-.lf : +8128
%+-.0lf : +8128
@@ -2304,7 +2304,7 @@ NAN
%+-.2lf : +8127.53
%+-.5lf : +8127.53400
%+-.10lf : +8127.5340000000
-%+-.30lf : +8127.534000000000000000000000000000
+%+-.30lf : +8127.533999999999650754030000000000
%+-1lf : +8127.534000
%+-1.lf : +8128
%+-1.0lf : +8128
@@ -2312,7 +2312,7 @@ NAN
%+-1.2lf : +8127.53
%+-1.5lf : +8127.53400
%+-1.10lf : +8127.5340000000
-%+-1.30lf : +8127.534000000000000000000000000000
+%+-1.30lf : +8127.533999999999650754030000000000
%+-2lf : +8127.534000
%+-2.lf : +8128
%+-2.0lf : +8128
@@ -2320,7 +2320,7 @@ NAN
%+-2.2lf : +8127.53
%+-2.5lf : +8127.53400
%+-2.10lf : +8127.5340000000
-%+-2.30lf : +8127.534000000000000000000000000000
+%+-2.30lf : +8127.533999999999650754030000000000
%+-5lf : +8127.534000
%+-5.lf : +8128
%+-5.0lf : +8128
@@ -2328,7 +2328,7 @@ NAN
%+-5.2lf : +8127.53
%+-5.5lf : +8127.53400
%+-5.10lf : +8127.5340000000
-%+-5.30lf : +8127.534000000000000000000000000000
+%+-5.30lf : +8127.533999999999650754030000000000
%+-10lf : +8127.534000
%+-10.lf : +8128
%+-10.0lf : +8128
@@ -2336,7 +2336,7 @@ NAN
%+-10.2lf : +8127.53
%+-10.5lf : +8127.53400
%+-10.10lf : +8127.5340000000
-%+-10.30lf : +8127.534000000000000000000000000000
+%+-10.30lf : +8127.533999999999650754030000000000
%+-30lf : +8127.534000
%+-30.lf : +8128
%+-30.0lf : +8128
@@ -2344,7 +2344,7 @@ NAN
%+-30.2lf : +8127.53
%+-30.5lf : +8127.53400
%+-30.10lf : +8127.5340000000
-%+-30.30lf : +8127.534000000000000000000000000000
+%+-30.30lf : +8127.533999999999650754030000000000
%#-lf : 8127.534000
%#-.lf : 8128.
%#-.0lf : 8128.
@@ -2352,7 +2352,7 @@ NAN
%#-.2lf : 8127.53
%#-.5lf : 8127.53400
%#-.10lf : 8127.5340000000
-%#-.30lf : 8127.534000000000000000000000000000
+%#-.30lf : 8127.533999999999650754030000000000
%#-1lf : 8127.534000
%#-1.lf : 8128.
%#-1.0lf : 8128.
@@ -2360,7 +2360,7 @@ NAN
%#-1.2lf : 8127.53
%#-1.5lf : 8127.53400
%#-1.10lf : 8127.5340000000
-%#-1.30lf : 8127.534000000000000000000000000000
+%#-1.30lf : 8127.533999999999650754030000000000
%#-2lf : 8127.534000
%#-2.lf : 8128.
%#-2.0lf : 8128.
@@ -2368,7 +2368,7 @@ NAN
%#-2.2lf : 8127.53
%#-2.5lf : 8127.53400
%#-2.10lf : 8127.5340000000
-%#-2.30lf : 8127.534000000000000000000000000000
+%#-2.30lf : 8127.533999999999650754030000000000
%#-5lf : 8127.534000
%#-5.lf : 8128.
%#-5.0lf : 8128.
@@ -2376,7 +2376,7 @@ NAN
%#-5.2lf : 8127.53
%#-5.5lf : 8127.53400
%#-5.10lf : 8127.5340000000
-%#-5.30lf : 8127.534000000000000000000000000000
+%#-5.30lf : 8127.533999999999650754030000000000
%#-10lf : 8127.534000
%#-10.lf : 8128.
%#-10.0lf : 8128.
@@ -2384,7 +2384,7 @@ NAN
%#-10.2lf : 8127.53
%#-10.5lf : 8127.53400
%#-10.10lf : 8127.5340000000
-%#-10.30lf : 8127.534000000000000000000000000000
+%#-10.30lf : 8127.533999999999650754030000000000
%#-30lf : 8127.534000
%#-30.lf : 8128.
%#-30.0lf : 8128.
@@ -2392,7 +2392,7 @@ NAN
%#-30.2lf : 8127.53
%#-30.5lf : 8127.53400
%#-30.10lf : 8127.5340000000
-%#-30.30lf : 8127.534000000000000000000000000000
+%#-30.30lf : 8127.533999999999650754030000000000
%+#lf : +8127.534000
%+#.lf : +8128.
%+#.0lf : +8128.
@@ -2400,7 +2400,7 @@ NAN
%+#.2lf : +8127.53
%+#.5lf : +8127.53400
%+#.10lf : +8127.5340000000
-%+#.30lf : +8127.534000000000000000000000000000
+%+#.30lf : +8127.533999999999650754030000000000
%+#0lf : +8127.534000
%+#0.lf : +8128.
%+#0.0lf : +8128.
@@ -2408,7 +2408,7 @@ NAN
%+#0.2lf : +8127.53
%+#0.5lf : +8127.53400
%+#0.10lf : +8127.5340000000
-%+#0.30lf : +8127.534000000000000000000000000000
+%+#0.30lf : +8127.533999999999650754030000000000
%+#1lf : +8127.534000
%+#1.lf : +8128.
%+#1.0lf : +8128.
@@ -2416,7 +2416,7 @@ NAN
%+#1.2lf : +8127.53
%+#1.5lf : +8127.53400
%+#1.10lf : +8127.5340000000
-%+#1.30lf : +8127.534000000000000000000000000000
+%+#1.30lf : +8127.533999999999650754030000000000
%+#2lf : +8127.534000
%+#2.lf : +8128.
%+#2.0lf : +8128.
@@ -2424,7 +2424,7 @@ NAN
%+#2.2lf : +8127.53
%+#2.5lf : +8127.53400
%+#2.10lf : +8127.5340000000
-%+#2.30lf : +8127.534000000000000000000000000000
+%+#2.30lf : +8127.533999999999650754030000000000
%+#5lf : +8127.534000
%+#5.lf : +8128.
%+#5.0lf : +8128.
@@ -2432,7 +2432,7 @@ NAN
%+#5.2lf : +8127.53
%+#5.5lf : +8127.53400
%+#5.10lf : +8127.5340000000
-%+#5.30lf : +8127.534000000000000000000000000000
+%+#5.30lf : +8127.533999999999650754030000000000
%+#10lf : +8127.534000
%+#10.lf : +8128.
%+#10.0lf : +8128.
@@ -2440,7 +2440,7 @@ NAN
%+#10.2lf : +8127.53
%+#10.5lf : +8127.53400
%+#10.10lf : +8127.5340000000
-%+#10.30lf : +8127.534000000000000000000000000000
+%+#10.30lf : +8127.533999999999650754030000000000
%+#30lf : +8127.534000
%+#30.lf : +8128.
%+#30.0lf : +8128.
@@ -2448,7 +2448,7 @@ NAN
%+#30.2lf : +8127.53
%+#30.5lf : +8127.53400
%+#30.10lf : +8127.5340000000
-%+#30.30lf : +8127.534000000000000000000000000000
+%+#30.30lf : +8127.533999999999650754030000000000
%-#lf : 8127.534000
%-#.lf : 8128.
%-#.0lf : 8128.
@@ -2456,7 +2456,7 @@ NAN
%-#.2lf : 8127.53
%-#.5lf : 8127.53400
%-#.10lf : 8127.5340000000
-%-#.30lf : 8127.534000000000000000000000000000
+%-#.30lf : 8127.533999999999650754030000000000
%-#1lf : 8127.534000
%-#1.lf : 8128.
%-#1.0lf : 8128.
@@ -2464,7 +2464,7 @@ NAN
%-#1.2lf : 8127.53
%-#1.5lf : 8127.53400
%-#1.10lf : 8127.5340000000
-%-#1.30lf : 8127.534000000000000000000000000000
+%-#1.30lf : 8127.533999999999650754030000000000
%-#2lf : 8127.534000
%-#2.lf : 8128.
%-#2.0lf : 8128.
@@ -2472,7 +2472,7 @@ NAN
%-#2.2lf : 8127.53
%-#2.5lf : 8127.53400
%-#2.10lf : 8127.5340000000
-%-#2.30lf : 8127.534000000000000000000000000000
+%-#2.30lf : 8127.533999999999650754030000000000
%-#5lf : 8127.534000
%-#5.lf : 8128.
%-#5.0lf : 8128.
@@ -2480,7 +2480,7 @@ NAN
%-#5.2lf : 8127.53
%-#5.5lf : 8127.53400
%-#5.10lf : 8127.5340000000
-%-#5.30lf : 8127.534000000000000000000000000000
+%-#5.30lf : 8127.533999999999650754030000000000
%-#10lf : 8127.534000
%-#10.lf : 8128.
%-#10.0lf : 8128.
@@ -2488,7 +2488,7 @@ NAN
%-#10.2lf : 8127.53
%-#10.5lf : 8127.53400
%-#10.10lf : 8127.5340000000
-%-#10.30lf : 8127.534000000000000000000000000000
+%-#10.30lf : 8127.533999999999650754030000000000
%-#30lf : 8127.534000
%-#30.lf : 8128.
%-#30.0lf : 8128.
@@ -2496,7 +2496,7 @@ NAN
%-#30.2lf : 8127.53
%-#30.5lf : 8127.53400
%-#30.10lf : 8127.5340000000
-%-#30.30lf : 8127.534000000000000000000000000000
+%-#30.30lf : 8127.533999999999650754030000000000
%0#lf : 8127.534000
%0#.lf : 8128.
%0#.0lf : 8128.
@@ -2504,7 +2504,7 @@ NAN
%0#.2lf : 8127.53
%0#.5lf : 8127.53400
%0#.10lf : 8127.5340000000
-%0#.30lf : 8127.534000000000000000000000000000
+%0#.30lf : 8127.533999999999650754030000000000
%0#1lf : 8127.534000
%0#1.lf : 8128.
%0#1.0lf : 8128.
@@ -2512,7 +2512,7 @@ NAN
%0#1.2lf : 8127.53
%0#1.5lf : 8127.53400
%0#1.10lf : 8127.5340000000
-%0#1.30lf : 8127.534000000000000000000000000000
+%0#1.30lf : 8127.533999999999650754030000000000
%0#2lf : 8127.534000
%0#2.lf : 8128.
%0#2.0lf : 8128.
@@ -2520,7 +2520,7 @@ NAN
%0#2.2lf : 8127.53
%0#2.5lf : 8127.53400
%0#2.10lf : 8127.5340000000
-%0#2.30lf : 8127.534000000000000000000000000000
+%0#2.30lf : 8127.533999999999650754030000000000
%0#5lf : 8127.534000
%0#5.lf : 8128.
%0#5.0lf : 8128.
@@ -2528,7 +2528,7 @@ NAN
%0#5.2lf : 8127.53
%0#5.5lf : 8127.53400
%0#5.10lf : 8127.5340000000
-%0#5.30lf : 8127.534000000000000000000000000000
+%0#5.30lf : 8127.533999999999650754030000000000
%0#10lf : 8127.534000
%0#10.lf : 000008128.
%0#10.0lf : 000008128.
@@ -2536,7 +2536,7 @@ NAN
%0#10.2lf : 0008127.53
%0#10.5lf : 8127.53400
%0#10.10lf : 8127.5340000000
-%0#10.30lf : 8127.534000000000000000000000000000
+%0#10.30lf : 8127.533999999999650754030000000000
%0#30lf : 00000000000000000008127.534000
%0#30.lf : 00000000000000000000000008128.
%0#30.0lf : 00000000000000000000000008128.
@@ -2544,7 +2544,7 @@ NAN
%0#30.2lf : 000000000000000000000008127.53
%0#30.5lf : 000000000000000000008127.53400
%0#30.10lf : 0000000000000008127.5340000000
-%0#30.30lf : 8127.534000000000000000000000000000
+%0#30.30lf : 8127.533999999999650754030000000000
%+0lf : +8127.534000
%+0.lf : +8128
%+0.0lf : +8128
@@ -2552,7 +2552,7 @@ NAN
%+0.2lf : +8127.53
%+0.5lf : +8127.53400
%+0.10lf : +8127.5340000000
-%+0.30lf : +8127.534000000000000000000000000000
+%+0.30lf : +8127.533999999999650754030000000000
%+01lf : +8127.534000
%+01.lf : +8128
%+01.0lf : +8128
@@ -2560,7 +2560,7 @@ NAN
%+01.2lf : +8127.53
%+01.5lf : +8127.53400
%+01.10lf : +8127.5340000000
-%+01.30lf : +8127.534000000000000000000000000000
+%+01.30lf : +8127.533999999999650754030000000000
%+02lf : +8127.534000
%+02.lf : +8128
%+02.0lf : +8128
@@ -2568,7 +2568,7 @@ NAN
%+02.2lf : +8127.53
%+02.5lf : +8127.53400
%+02.10lf : +8127.5340000000
-%+02.30lf : +8127.534000000000000000000000000000
+%+02.30lf : +8127.533999999999650754030000000000
%+05lf : +8127.534000
%+05.lf : +8128
%+05.0lf : +8128
@@ -2576,7 +2576,7 @@ NAN
%+05.2lf :