Fix partially Issue 20371 - std.format limited to 500 characters for floats

This commit is contained in:
Bernhard Seckinger 2019-11-17 13:56:14 +01:00
parent e084f5eb33
commit 5516a03e68

View file

@ -2882,6 +2882,25 @@ useSnprintf:
assert(format!"%a"(nextUp(0.0)) == "0x0.0000000000001p-1022");
}
// issue 20371
@safe unittest
{
assert(format!"%.1000a"(1.0) ==
"0x1.000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"000000000000000000000000000000000000000000000000000000000000000000000000000000"
~"0000000000000000000000000000000000000000000000000000000000000000000p+0");
}
/*
Formatting a `creal` is deprecated but still kept around for a while.
*/