Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9210251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:01:38+00:00 2026-06-18T01:01:38+00:00

Possible Duplicate: Inaccurate Logarithm in Python Why are the math.log10(x) and math.log(x,10) results different?

  • 0

Possible Duplicate:
Inaccurate Logarithm in Python

Why are the math.log10(x) and math.log(x,10) results different?

In [1]: from math import *

In [2]: log10(1000)
Out[2]: 3.0

In [3]: log(1000,10)
Out[3]: 2.9999999999999996
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:01:39+00:00Added an answer on June 18, 2026 at 1:01 am

    math.log10 and math.log(x, 10) are using different algorithm, and the former is usually more accurate. Actually, it’s a known issue(Issue6765): math.log, log10 inconsistency.

    One may think in this way: log10(x) has a fixed base, hence it can be computed directly by some mathematical approximation formula(e.g. Taylor series), while log(x, 10) comes from a more general formula with two variables, which may be indirectly calculated by log(x) / log(10)(at least the precision of log(10) will affect the precision of quotient). So it’s natural that the former way is both faster and more accurate, and that is reasonable considering that it takes advantage of a pre-known logarithmic base(i.e. 10).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Retain precision with Doubles in java import static java.lang.System.out; public class q2{
Possible Duplicate: Find out the instance id from within an ec2 machine I am
Possible Duplicate: Python : how to append new elements in a list of list?
Possible Duplicate: “using” keyword in java I'm transitioning from C# to java, so please
Possible Duplicate: Learning to write a compiler I looked around trying to find out
Possible Duplicate: Cyclic module dependencies and relative imports in Python Consider the following example
Possible Duplicate: Get the size of a list in python? I need to be
Possible Duplicate: Variable doesn’t get returned from AJAX function I have this function: function
Possible Duplicate: Floating point arithmetic not producing exact results in Java Floating point inaccuracy
Possible Duplicate: Python urllib2 Progress Hook I have a script which uploads a file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.