aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt12
1 files changed, 7 insertions, 5 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index e1a8ba079a..5340830947 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -5683,9 +5683,10 @@ printf({fmt}, {expr1} ...) *printf()*
%04x hex number padded with zeros to at least 4 characters
%X hex number using upper case letters
%o octal number
- %f floating point number in the form 123.456
- %e floating point number in the form 1.234e3
- %E floating point number in the form 1.234E3
+ %f floating point number as 12.23, inf, -inf or nan
+ %F floating point number as 12.23, INF, -INF or NAN
+ %e floating point number as 1.23e3, inf, -inf or nan
+ %E floating point number as 1.23E3, INF, -INF or NAN
%g floating point number, as %f or %e depending on value
%G floating point number, as %f or %E depending on value
%% the % character itself
@@ -5810,8 +5811,9 @@ printf({fmt}, {expr1} ...) *printf()*
digits after the decimal point. When the precision is
zero the decimal point is omitted. When the precision
is not specified 6 is used. A really big number
- (out of range or dividing by zero) results in "inf".
- "0.0 / 0.0" results in "nan".
+ (out of range or dividing by zero) results in "inf"
+ or "-inf" with %f (INF or -INF with %F).
+ "0.0 / 0.0" results in "nan" with %f (NAN with %F).
Example: >
echo printf("%.2f", 12.115)
< 12.12