Ivona Tinkle

Greenhorn

Posts: 2

posted 13 years ago

I'm doing a calculator project and I need to do "Log" (not knowing if they want to the base 2, 10 or whatever). Using .Math, I find a log function however it only does log to the base e(natural log)... what the?! Can someone please tell me how to get log to the base 10, or even better a log where you can choose what base you want to use.

~thanks~

~thanks~

Tim West

Ranch Hand

Posts: 539

posted 13 years ago

One of the fundamental properties of logarithms:

(all a, b, x). log_a b = (log_x b) / (log_x a)

You'll probably want x = e in the formula above, since you can do logs easily that way. Of course, all a, b, x must be > 0.

On a side note..."Ivona Tinkle" - is that a Simpsons reference or were your parents, ummm, taking the p!ss?

--Tim

(all a, b, x). log_a b = (log_x b) / (log_x a)

You'll probably want x = e in the formula above, since you can do logs easily that way. Of course, all a, b, x must be > 0.

On a side note..."Ivona Tinkle" - is that a Simpsons reference or were your parents, ummm, taking the p!ss?

--Tim

Ivona Tinkle

Greenhorn

Posts: 2

posted 13 years ago

Well, Mr. Brett Tinkle, here at the Ranch we do have what we call our naming policy, which specifically prohibits this particular flavor of "being smart" (although we do encourage other kinds of smartness, and other kinds of having fun as well.) Please head over here and mend your ways, ASAP. Thanks, pardner. Hope to see you around the Ranch!