Commit: runtime(doc): Improve :help expr-number, mention unary +/-

Christian Brabandt <[email protected]> Mon, 10 Aug 2026 20:45:08 +0200
Newsgroups gmane.editors.vim.devel
Message-ID <[email protected]>
runtime(doc): Improve :help expr-number, mention unary +/-

Commit: https://github.com/vim/vim/commit/6163d99a32a559e0a5387989f09c43c7870c249f
Author: Doug Kearns <[email protected]>
Date:   Mon Aug 10 18:36:35 2026 +0000

    runtime(doc): Improve :help expr-number, mention unary +/-
    
    - Mention unary +/- use in both integer and floating-point descriptions.
    - Add "0b" binary prefix tag to match existing "0o" and "0x" tags.
    
    closes: #20997
    
    Signed-off-by: Doug Kearns <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 222dbcc2a..b8f6219e4 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 9.2.  Last change: 2026 Aug 08
+*eval.txt*	For Vim version 9.2.  Last change: 2026 Aug 10
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1703,7 +1703,7 @@ number
 ------
 number			number constant			*expr-number*
 
-			*0x* *hex-number* *0o* *octal-number* *binary-number*
+			*0x* *hex-number* *0o* *octal-number* *0b* *binary-number*
 Integer numbers can be written in multiple forms:
 
 	{N}		decimal
@@ -1715,9 +1715,6 @@ Integer numbers can be written in multiple forms:
 {N} is a sequence of decimal digits (0-9), hexadecimal digits (0-9, a-f and
 A-F), octal digits (0-7) or binary digits (0 or 1).
 
-Note: A leading "-" or "+" is not part of the number, it is the unary operator
-|expr9| applied to it.
-
 Assuming 64 bit numbers are used (see |v:numbersize|) an unsigned number is
 truncated to 0x7fffffffffffffff or 9223372036854775807.  You can use -1 to get
 0xffffffffffffffff.
@@ -1725,6 +1722,9 @@ truncated to 0x7fffffffffffffff or 9223372036854775807.  You can use -1 to get
 In |scriptversion-4| and in |Vim9| script, single quotes may appear between digits
 to improve readability; these are ignored.
 
+A leading "+" or "-" is not part of an integer literal.  E.g., -123 is an
+expression, the unary operator |expr-unary--| applied to the number 123.
+
 Examples:
 	0xDEAD
 	57005
@@ -1751,6 +1751,10 @@ locale is.
 In |scriptversion-4| and in |Vim9| script, single quotes may appear between the
 digits in {N} to improve readability; these are ignored.
 
+A leading "+" or "-" is not part of a floating point literal.  E.g., -1.0e-3
+is an expression, the unary operator |expr-unary--| applied to the float 1.0e-3.
+The "-" in the exponent is part of the literal.
+
 Examples:
 	123.456
 	0.0001
diff --git a/runtime/doc/tags b/runtime/doc/tags
index e83116386..afb7a3626 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -1955,6 +1955,7 @@ $quote	eval.txt	/*$quote*
 09.2	usr_09.txt	/*09.2*
 09.3	usr_09.txt	/*09.3*
 09.4	usr_09.txt	/*09.4*
+0b	eval.txt	/*0b*
 0o	eval.txt	/*0o*
 0x	eval.txt	/*0x*
 10.1	usr_10.txt	/*10.1*

-- 
-- 
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 [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1wtUzk-005jug-Av%40256bit.org.