![]() The log10 function does it in base 10, that is, it finds x where your number = 10^x. The log function does it in base e, that is, it takes the natural logarithm, or, it finds x where your number = e^x. The logarithm of a number can be taken in any base. Of course, you could always use the log10 function to get the base 10 logarithm of the number instead, and then you would need to use pow(10, logarithm) to get the original value. Since the log function returns the natural logarithm of the number, you need to use exp, not pow to get the inverse, since the pow function accepts the base as an argument, and you don't need this since you're taking the natural logarithm of the number, that is, finding x in where the number = e^x. ![]() You're looking for the exp function: ans = exp(exponent)
0 Comments
Leave a Reply. |