_writeDouble

private fnvoid _writeDouble(W)(double d, ref W buf) @safe

Write 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

dThe double value to write.
bufThe output buffer to write to.