diff --git a/std/format.d b/std/format.d index cae32ff21..5d07ab07e 100644 --- a/std/format.d +++ b/std/format.d @@ -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. */