diff options
author | Jurica Bradaric <jurica.bradaric@avl.com> | 2017-03-07 21:05:02 +0100 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2017-03-20 22:47:09 +0100 |
commit | cad9a76be28f2ee3bd2c48ae959243aa7cfdb02a (patch) | |
tree | 8a764f37d141b6f2391a423009386bd003fbb2dd /runtime | |
parent | 6ca580be9bffcccc513bfce383a6e1f9f026614c (diff) | |
download | rneovim-cad9a76be28f2ee3bd2c48ae959243aa7cfdb02a.tar.gz rneovim-cad9a76be28f2ee3bd2c48ae959243aa7cfdb02a.tar.bz2 rneovim-cad9a76be28f2ee3bd2c48ae959243aa7cfdb02a.zip |
vim-patch:7.4.2291
Problem: printf() handles floats wrong when there is a sign.
Solution: Fix placing the sign. Add tests. (Dominique Pelle)
https://github.com/vim/vim/commit/04186095346daa60e82e981dad114de2b641d672
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 12 |
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 |