PowerShell 中数字后缀的完整列表是什么? [英] What is the full list of number suffixes in PowerShell?
本文介绍了PowerShell 中数字后缀的完整列表是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以在 PowerShell 数字文字上使用的完整后缀列表是什么?
到目前为止,我发现:
What is the full list of suffixes you can use on PowerShell number literals?
So far I have found:
╔════════╦═════════╦════════════════════════╗
║ Suffix ║ Example ║ Result ║
╠════════╬═════════╬════════════════════════╣
║ L ║ 1L ║ Type = Int64 ║
║ D ║ 1D ║ Type = Decimal ║
║ KB ║ 1KB ║ 1KB = 1024 ║
║ MB ║ 1MB ║ 1MB = 1048576 ║
║ GB ║ 1GB ║ 1GB = 1073741824 ║
║ TB ║ 1TB ║ 1TB = 1099511627776 ║
║ PB ║ 1PB ║ 1PB = 1125899906842624 ║
╚════════╩═════════╩════════════════════════╝
但我找不到可以列出所有这些的来源.
But I can't find a source that would list all of them.
推荐答案
根据 PowerShell 语言规范 (V3) 是完整的集合.
According to the PowerShell Language Specification (V3) that is the complete set.
- §2.3.5.1.1 Integer Literals 包括:
l
、kb
、mb
、gb
、tb
和pb
. - §2.3.5.1.2 Real Literals 添加
d
.
- §2.3.5.1.1 Integer Literals includes:
l
,kb
,mb
,gb
,tb
, andpb
. - §2.3.5.1.2 Real Literals adds
d
.
据我所知(尚未发布对规范的更新)PowerShell V4 没有添加任何进一步的后缀.
As far as I am aware (no update to the specification has been published) PowerShell V4 does not add any further suffixes.
这篇关于PowerShell 中数字后缀的完整列表是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文