PowerShell 是否具有 Infinity 值 [英] Does PowerShell have an Infinity value
本文介绍了PowerShell 是否具有 Infinity 值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
PowerShell 是否有无穷大的变量或值?
Does PowerShell have a variable or value for infinity?
也许类似于 $null 变量?
Perhaps similar to the $null variable?
我试过 $inifinity.我也试过 1/0 来生成值.
I have tried $inifinity. I have also tried 1/0 to generate the value.
推荐答案
有[double]::PositiveInfinity
.我怀疑如果你使用 1.0/0.0
你会得到这个值.1/0
应该会产生错误,因为任何整数类型都没有无穷大值.
There is [double]::PositiveInfinity
. I suspect if you used 1.0/0.0
you would get this value. 1/0
should produce an error, as there is no infinity value for any of the integral types.
这篇关于PowerShell 是否具有 Infinity 值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文