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 9123521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:21:38+00:00 2026-06-17T06:21:38+00:00

why is this so? when i try out: Math.pow(2,58)=288230376151711740 while in fact, it is

  • 0

why is this so?

when i try out:

Math.pow(2,58)=288230376151711740
while in fact, it is 288230376151711744

or

Math.pow(2,57)=144115188075855870
while it really equals 144115188075855872

it just throws that number without any warning.
i would understand if it stopped going above some number in case of maximum value reached. however, this seems to calculate the first n digits correctly and then go wrong at the very end of the digits only

  • 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-17T06:21:39+00:00Added an answer on June 17, 2026 at 6:21 am

    You’ve ran out of Number type display precision. The trick is that with powers of 2 the actual value stored in the variable will be precise, while when you’ll trace it the engine will truncate the displayed value by 16 digits, as it divides by 10 in process, and leftovers will eventually hit “machine zero” if compared to original value taken without exponential part. This is made to prevent white noise generated by imprecise floating-point division to be displayed. You can work around this issue if you’ll advance to big integers/floating point numbers, that store more bits than a double precision number.

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

Sidebar

Related Questions

First of all, pardon my hacky code, I'm just trying to try this out
I get this, when I try to run my PHP. When I comment out
I just wanted to try out Flying Saucer to generate a PDF from an
I tried to do this: try{ (function($){ ... my plugin stuff })(jQuery); }catch(er){ alert(an
I have some code like this: try { doStuff(); } catch(SpecificException) { if(e.Message ==
I am currently using code similar to this: try { // IE ONLY var
I saw some code like this: try { db.store(mydata); } finally { db.cleanup(); }
Often I find myself coming across code like this: try { StreamWriter strw =
I am trying to get twitter updates like this: try { $doc = new
When parsing an xml file in android, I'm doing like this: try { InputStream

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.