Export (0) Print
Expand All
Expand Minimize

Converting VBScript's Log Function


Windows PowerShell


Definition: Returns the natural logarithm of a number.

Log

Most people probably have the natural logarithms for all known numbers committed to memory. If you don't, and you need to know the log for a particular number, then use the System.Math class and the Log method. This command returns the log of 100 and assigns the value to the variable $a:



$a = [math]::log(100)

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



4.60517018598809


Return to the VBScript to Windows PowerShell home page

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