t/op/splice.t See if splice works
t/op/split.t See if split works
t/op/sprintf.t See if sprintf works
+t/op/sprintf2.t See if sprintf works
t/op/srand.t See if srand works
t/op/stash.t See if %:: stashes work
t/op/stat.t See if stat works
}
}
+#ifndef USE_LONG_DOUBLE
/* special-case "%.<number>[gf]" */
if ( patlen <= 5 && pat[0] == '%' && pat[1] == '.'
&& (pat[patlen-1] == 'g' || pat[patlen-1] == 'f') ) {
return;
if (*pp == 'g') {
if (digits < sizeof(ebuf) - NV_DIG - 10) { /* 0, point, slack */
- Gconvert((double)nv, digits, 0, ebuf);
+ Gconvert(nv, digits, 0, ebuf);
sv_catpv(sv, ebuf);
if (*ebuf) /* May return an empty string for digits==0 */
return;
}
}
}
+#endif /* !USE_LONG_DOUBLE */
if (!args && svix < svmax && DO_UTF8(*svargs))
has_utf8 = TRUE;
if ( !(width || left || plus || alt) && fill != '0'
&& has_precis && intsize != 'q' ) { /* Shortcuts */
if ( c == 'g') {
- Gconvert((double)nv, precis, 0, PL_efloatbuf);
+ Gconvert(nv, precis, 0, PL_efloatbuf);
if (*PL_efloatbuf) /* May return an empty string for digits==0 */
goto float_converted;
} else if ( c == 'f' && !precis) {
--- /dev/null
+#!./perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require './test.pl';
+}
+
+plan tests => 2;
+
+is(
+ sprintf("%.40g ",0.01),
+ sprintf("%.40g", 0.01)." ",
+ q(the sprintf "%.<number>g" optimization)
+);
+is(
+ sprintf("%.40f ",0.01),
+ sprintf("%.40f", 0.01)." ",
+ q(the sprintf "%.<number>f" optimization)
+);