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

  • Home
  • SEARCH
  • 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 482509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:06:13+00:00 2026-05-13T01:06:13+00:00

I am having a problem handling large numbers. I need to calculate the log

  • 0

I am having a problem handling large numbers.

I need to calculate the log of a very large number. The number is the product of a series of numbers. For example: log(2x3x66x435x444) though my actual series are longer.

I am getting a math overflow because product grows very large, very quickly.

Are there special math libraries to handle huge numbers? Any ideas how I can solve this?

  • 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-05-13T01:06:14+00:00Added an answer on May 13, 2026 at 1:06 am

    There is a neat mathematical solution to this problem.

    Rather than obtaining the product of a series by multiplying each number, you can use their log values. The noted principle is:

    log(a*b) = log(a) + log(b)
    

    For the example series (2, 3, 66, 435, 444), the brute-force product is calculated as 2 * 3 * 66 * 435 * 44 = 76,483,440.

    However, you can also obtain the product from the sum of the logs. For a series (n1, n2, n3, n4,…) the product of the series is: 10 ^ (log(n1) + log(n2) + log(n3) + log(n4)…)

    log(2) = 0.30103
    log(3) = 0.47712
    log(66) = 1.8195
    log(435) = 2.6384
    log(444) = 2.6474
    

    The sum of the values is roughly 7.8835. The product of the series is 10 ^ 7.8835 (76,483,440).

    Since you’re looking for the log of the product of the series, just the sum of the individual log() values, 7.8835. That’s it.

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

Sidebar

Related Questions

I want to use NSFileHandle to write large text files to avoid handling very
I'm having problem with my class. I'm going to make comparision operators of my
I know this looks a bit long but i tried to explain the problem
This is a C# winforms app. Preface: I am creating a form that will
After upgrading to the 4.1 iOS SDK my unit test bundles always return with
I believe that readability and the KISS principle are the most important things in
I have an old .net 2005 web site that has some asp pages and
I am using the JTOpen JDBC driver to connect to the iSeries (aka AS/400,
I'm developing an android app (if you want more info http://www.txty.mobi ) and I
What's the best practice for creating drop shadows around html where the html can

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.