From 19ea7ca63cb0eb755e863926e0c6fd3c03601097 Mon Sep 17 00:00:00 2001 From: Mason Remaley Date: Sat, 30 Dec 2023 07:14:54 -0500 Subject: [PATCH] Update formatFloat* docs to reflect limitation w/ large floats --- lib/std/fmt.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index ad3b2d8452..df6aac2e21 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -1009,8 +1009,10 @@ pub fn formatBuf( } /// Print a float in scientific notation to the specified precision. Null uses full precision. -/// It should be the case that every full precision, printed value can be re-parsed back to the -/// same type unambiguously. +/// For floats with less than 64 bits, it should be the case that every full precision, printed +/// value can be re-parsed back to the same type unambiguously. +/// +/// Floats with more than 64 are currently rounded, see https://github.com/ziglang/zig/issues/1181 pub fn formatFloatScientific( value: anytype, options: FormatOptions, @@ -1213,6 +1215,8 @@ pub fn formatFloatHexadecimal( /// Print a float of the format x.yyyyy where the number of y is specified by the precision argument. /// By default floats are printed at full precision (no rounding). +/// +/// Floats with more than 64 bits are not yet supported, see https://github.com/ziglang/zig/issues/1181 pub fn formatFloatDecimal( value: anytype, options: FormatOptions,