vim-patch:6163d99: runtime(doc): Improve :help expr-number, mention unary +/- (#41267)

- Mention unary +/- use in both integer and floating-point descriptions.
- Add "0b" binary prefix tag to match existing "0o" and "0x" tags.

closes: vim/vim#20997

6163d99a32

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:
zeertzjq
2026-08-11 10:19:38 +08:00
committed by GitHub
parent 5f15c0e959
commit 5bc08dbb46

View File

@@ -1330,7 +1330,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
@@ -1342,8 +1342,8 @@ 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
|expr7| applied to it.
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
@@ -1362,6 +1362,10 @@ Floating point numbers can be written in two forms:
Only a decimal point is accepted, not a comma. No matter what the current
locale is.
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