Does PowerShell have an Infinity value

Question:

Does PowerShell have a variable or value for infinity?

Perhaps similar to the $null variable?

I have tried $inifinity. I have also tried 1/0 to generate the value.

Answer:

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.

Source:

Does PowerShell have an Infinity value by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply