Issue Details
Per PowerShell/PowerShell#7901 and PowerShell/PowerShell#7813
Also ref: PowerShell/PowerShell#7557
With these changes approved by PowerShell committee and partially merged to master already, we need to add documentation for the new numeric literals.
The linked PR descriptions have fairly extensive details, but see also a blog post I posted in order to better explain the details in places.
Of specific note:
- Smaller numeric types can and will fail to parse if specified with a multiplier that causes the value to exceed their range, e.g.,
200sgb will fail parsing checks as the final value exceeds [short]::MaxValue
- Yes, specifying huge values will still fail if you ask for a
short result, just like casting to [short] will fail. E.g., 40000s will fail.
- The suffixes take on an additional function with hexadecimal literals, which causes them to be parsed with the usual sign bit as part of the value (e.g., although
0xFFFFFFFF -eq -1, 0xFFFFFFFFu -eq 4294967295)
Sidenote:
I am thus far unable to find any mention or reference to the preexisting L/l numeric suffix for Int64 literals that has been supported in PowerShell for some time now (indeed, there is no mention of when it was introduced, either).
It should perhaps be considered that this should be an additional about help topic -- perhaps about_Numbers or about_Numeric_Literals?
I'm more than willing to write this document myself; but I'd appreciate some guidance and opinion from others on the best way to document these. 😄
Version(s) of document impacted
Reason(s) for not selecting all version of documents
Issue Details
Per PowerShell/PowerShell#7901 and PowerShell/PowerShell#7813
Also ref: PowerShell/PowerShell#7557
With these changes approved by PowerShell committee and partially merged to master already, we need to add documentation for the new numeric literals.
The linked PR descriptions have fairly extensive details, but see also a blog post I posted in order to better explain the details in places.
Of specific note:
200sgbwill fail parsing checks as the final value exceeds[short]::MaxValueshortresult, just like casting to[short]will fail. E.g.,40000swill fail.0xFFFFFFFF -eq -1,0xFFFFFFFFu -eq 4294967295)Sidenote:
I am thus far unable to find any mention or reference to the preexisting
L/lnumeric suffix forInt64literals that has been supported in PowerShell for some time now (indeed, there is no mention of when it was introduced, either).It should perhaps be considered that this should be an additional
abouthelp topic -- perhapsabout_Numbersorabout_Numeric_Literals?I'm more than willing to write this document myself; but I'd appreciate some guidance and opinion from others on the best way to document these. 😄
Version(s) of document impacted
Reason(s) for not selecting all version of documents