Commit 19ea7ca63c

Mason Remaley <MasonRemaley@users.noreply.github.com>
2023-12-30 13:14:54
Update formatFloat* docs to reflect limitation w/ large floats
1 parent 27d4bf7
Changed files (1)
lib
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,