• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Log to the base 10?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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~
 
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ivona Tinkle
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, and my name is actual Brett, I was just being smart (yes it was off the simpsons, though all the episodes kinda merge to one after a while).
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!