<p>I want to get the base 10 logarithm of a Fixnum using Ruby, but found that n.log or n.log10 are not defined. Math::log is defined but uses a different base than 10.</p>

<p>What is the easiest way to get the base 10 logarithm of a Fixnum?</p>

[{'answer_id': 51423, 'author': 'Wes Oldenbeuving', 'author_id': 4187, 'author_profile': 'https://Stackoverflow.com/users/4187', 'pm_score': 2, 'selected': False, 'text': '<p>Reading the documentation for module Math the answer is really obvious:</p>\n\n<pre><code>Math::log10(n) \n</code></pre>\n\n<p>This gives the base 10 logarithm of n.</p>\n'}, {'answer_id': 51424, 'author': 'Gishu', 'author_id': 1695, 'author_profile': 'https://Stackoverflow.com/users/1695', 'pm_score': 0, 'selected': False, 'text': '<p><a href="http://www.ruby-doc.org/core-1.8.7/classes/Math.html#M001197" rel="nofollow noreferrer">Math.log10</a>(numeric) => float\nreturns base 10 log</p>\n'}, {'answer_id': 51426, 'author': 'Slartibartfast', 'author_id': 4433, 'author_profile': 'https://Stackoverflow.com/users/4433', 'pm_score': 4, 'selected': True, 'text': '<p>There is  </p>\n\n<pre><code>Math::log10 (n)\n</code></pre>\n\n<p>And there is also a property of logarithms that <code>logx(y) = log(y)/log(x)</code></p>\n'}]
['https://Stackoverflow.com/questions/51420', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4187/']