On my computer the format command below produces "0x8p-23" which is inconsitent with the results from float/double, where the first digit after "0x" is always a 1 (leaving aside corner cases). The test below should work independent of the type of real used. void main() { import std.format : format; real r = .00000095367431640625L; assert(format("%a", r) == "0x1p-20"); // fails }
@berni44 created dlang/phobos pull request #7951 "std.format: Replace snprintf for x87-reals" fixing this issue: - Fix Issue 20536 - std.format: %a on reals is inconsistent with %a on float/double https://github.com/dlang/phobos/pull/7951
dlang/phobos pull request #7951 "std.format: Replace snprintf for x87-reals" was merged into master: - c9121a8c8930b06fca9d8ee6963b630b1cbae59e by berni44: Fix Issue 20536 - std.format: %a on reals is inconsistent with %a on float/double https://github.com/dlang/phobos/pull/7951