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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:46:46+00:00 2026-05-31T21:46:46+00:00

Math.sqrt(); seems to work fine with any number less than 310 characters long. However,

  • 0

Math.sqrt(); seems to work fine with any number less than 310 characters long.

However, any number 310 chars or over will return infinity…

If you want to test it out yourself, here it is on jsfiddle http://jsfiddle.net/gqhk9/2

Anyway, I need to get the square root of numbers including some which are 310 chars and longer.

How can I do that in js?

  • 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-31T21:46:47+00:00Added an answer on May 31, 2026 at 9:46 pm

    It’s not an issue with Math.sqrt – get rid of the Math.sqrt call and you’ll still see infinity. Basically, Javascript can’t cope with numbers that big – it runs out of the range of 64-bit floating point IEEE 754 values. You’ll need to find some sort of library for handling arbitrary-sized integers.

    Note that even for numbers smaller than 10309, you’re still going to be losing information after the first ~15 digits. If you care about all of those digits, again you should be looking at specialist maths libraries.

    A quick look around the web found BigInt.js referenced a few times, but I don’t know how good it is.

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

Sidebar

Related Questions

I was looking over this code to calculate math.sqrt in Java. Why did they
I wrote the following program to prime factorize a number: import math def prime_factorize(x,li=[]):
From the Mozilla Developer Network : [1,4,9].map(Math.sqrt) will yield: [1,2,3] Why then does this:
Newbie ActionScript 3 question: why does (Math.sqrt((r * r - (r - i) *
Math escapes me today. How do I find the X speed and the Y
math.h is not really a documentation. Is there something else that will describe these
import math def p(n): return 393000*((288200/393000)^n * math.exp(-(288200/393000)))/math.factorial(n) print p(3) When I run it,
This is basically a math problem, but very programing related: if I have 1
I taken math in college (trigonometry, calculus II...) but I don't know why you
Need a Math Editor to integrate to my application written on C# to be

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.