Converting VBScript's Exp Function

Definition: Returns e (the base of natural logarithms) raised to a power.

Exp

You say your company will go broke unless you can find a way to raise e to a specified power? Relax; in Windows PowerShell you can do this by using the System.Math class and the Exp method. Here’s an example that raises e to the second power and assigns the resulting value to the variable $a:

$a = [math]::exp(2)

When you run this command and then echo back the value of $a you should get the following:

7.38905609893065 

Return to the VBScript to Windows PowerShell home page