From 373855c1b0ec3e5e66003e94aa65344bf53078a8 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 26 Jan 2025 13:49:54 -0800 Subject: [PATCH] Clarify difference in FP representation --- doc/api.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/api.md b/doc/api.md index 80296ea4e479..e83eb8f6ddc4 100644 --- a/doc/api.md +++ b/doc/api.md @@ -669,5 +669,13 @@ following differences: - Names are defined in the `fmt` namespace instead of `std` to avoid collisions with standard library implementations. + - Width calculation doesn't use grapheme clusterization. The latter has been implemented in a separate branch but hasn't been integrated yet. + +- The default floating-point representation in {fmt} uses the smallest + precision that provides round-trip guarantees similarly to other languages + like Java and Python. `std::format` is currently specified in terms of + `std::to_chars` which tries to generate the smallest number of characters + (ignoring redundant digits and sign in exponent) and may procude more + decimal digits than necessary.