Export (0) Print
Expand All
Expand Minimize

Converting VBScript's Exp Function


Windows PowerShell


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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft