authorgravatar for mason@anthropicstudios.comMason Remaley <mason@anthropicstudios.com> 2023-12-30 07:14:54-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-12-30 14:14:54+02:00
log19ea7ca63cb0eb755e863926e0c6fd3c03601097
treeb0464df3a5d4d2d37307ba1fc15bdce478781c02
parent27d4bf753467894836e960bced73740c95e61db8
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Update formatFloat* docs to reflect limitation w/ large floats


1 files changed, 6 insertions(+), 2 deletions(-)

lib/std/fmt.zig+6-2
......@@ -1009,8 +1009,10 @@ pub fn formatBuf(
10091009}
10101010
10111011/// Print a float in scientific notation to the specified precision. Null uses full precision.
1012/// It should be the case that every full precision, printed value can be re-parsed back to the
1013/// same type unambiguously.
1012/// For floats with less than 64 bits, it should be the case that every full precision, printed
1013/// value can be re-parsed back to the same type unambiguously.
1014///
1015/// Floats with more than 64 are currently rounded, see https://github.com/ziglang/zig/issues/1181
10141016pub fn formatFloatScientific(
10151017 value: anytype,
10161018 options: FormatOptions,
......@@ -1213,6 +1215,8 @@ pub fn formatFloatHexadecimal(
12131215
12141216/// Print a float of the format x.yyyyy where the number of y is specified by the precision argument.
12151217/// By default floats are printed at full precision (no rounding).
1218///
1219/// Floats with more than 64 bits are not yet supported, see https://github.com/ziglang/zig/issues/1181
12161220pub fn formatFloatDecimal(
12171221 value: anytype,
12181222 options: FormatOptions,