Re: RFE: ambiguity under :help printf()

2017-01-29 Fir de Conversatie Bram Moolenaar

Tony Mechelynck wrote:

> Line 5977 of the eval.txt helpfile says:
> 
>   %Gfloating point number, as %f or %E depending on value
> 
> This is ambiguous if the value is NaN or =C2=B1INF: is the result in upper
> case (as for %E) or in lower case (as for %f)? I propose to replace %f
> by %F in that line to remove the ambiguity, as experiment shows that,
> for instance, printf('%G', 1.0/0) is output as INF not inf.
> 
> I'm attaching, for your convenience, a patch for the proposed change.

Thanks.

-- 
There are 10 kinds of people: Those who understand binary and those who don't.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RFE: ambiguity under :help printf()

2017-01-29 Fir de Conversatie Tony Mechelynck
Line 5977 of the eval.txt helpfile says:

  %Gfloating point number, as %f or %E depending on value

This is ambiguous if the value is NaN or ±INF: is the result in upper
case (as for %E) or in lower case (as for %f)? I propose to replace %f
by %F in that line to remove the ambiguity, as experiment shows that,
for instance, printf('%G', 1.0/0) is output as INF not inf.

I'm attaching, for your convenience, a patch for the proposed change.

Best regards,
Tony.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--- a/runtime/doc/eval.txt  2017-01-29 00:38:48.758677458 +0100
+++ b/runtime/doc/eval.txt  2017-01-29 12:24:26.869741766 +0100
@@ -5969,17 +5969,17 @@
  %Xhex number using upper case letters
  %ooctal number
  %08b  binary number padded with zeros to at least 8 chars
  %ffloating point number as 12.23, inf, -inf or nan
  %Ffloating point number as 12.23, INF, -INF or NAN
  %efloating point number as 1.23e3, inf, -inf or nan
  %Efloating point number as 1.23E3, INF, -INF or NAN
  %gfloating point number, as %f or %e depending on value
- %Gfloating point number, as %f or %E depending on value
+ %Gfloating point number, as %F or %E depending on value
  %%the % character itself
 
Conversion specifications start with '%' and end with the
conversion type.  All other characters are copied unchanged to
the result.
 
The "%" starts a conversion specification.  The following
arguments appear in sequence: