_writeDouble
private fn
void _writeDouble(W)(double d, ref W buf) @safeWrite a double value in RFC 8259 compliant format.
Emits the shortest representation that round-trips: precision is tried from %.15g up to %.17g and the first output whose re-parse equals the original value wins (N041). This matches mainstream JSON serializers and avoids bloated output like 0.10000000000000001 while still guaranteeing exact round-trips. Lowercase 'e' and portable notation come from the %g family.
Parameters
d | The double value to write. |
buf | The output buffer to write to. |