How do I raise X to the power of Y in Powershell?

Question:

I (apparently wrongly) assumed there would be a built-in power operator or function in Powershell, but I it seems there is not, or is there?

Answer:

As you’ve found, real exponentation can be achieved with some accuracy by calling [Math]::Pow().

For large integer exponentiation, you might want to use [bigint]::Pow() instead:

Source:

How do I raise X to the power of Y in Powershell? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply