The built-in log() function can only obtain the natural logarithm of a number. The following logx() function supports logarithms of any base.
- ' Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved.
- ' This work is licensed under the Creative Commons Attribution License. To view
- ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
- ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
- ' 94305, USA.
- ' Logarithm to any base.
- function logx(number, base)
- logx = log(number) / log(base)
- end function
You need to login to post a comment.