About 165,000 results
Open links in new tab
  1. JavaScript: Calculate the nth root of a number - Stack Overflow

    Sep 5, 2011 · For the special cases of square and cubic root, it's best to use the native functions Math.sqrt and Math.cbrt respectively. As of ES7, the exponentiation operator ** can be used to …

  2. javascript - Faster Alternative to Math.sqrt () - Stack Overflow

    Jan 1, 2017 · Of the two operations in the question, I'd guess that generating the random number is the slower one. The square root is essentially loading the argument on the FPU stack, …

  3. Square each number in an array in javascript - Stack Overflow

    May 26, 2014 · Note that sqrt is the "square root of", which is different from "the square of". Observing a simple Math.sqrt(10) vs 10 * 10 should have indicated exactly what "didn't work". …

  4. JavaScript - Improving algorithm for finding square roots of …

    Mar 8, 2016 · To find the square root of a perfect square you should keep on subtracting it with consecutive odd numbers (starting from one) until it is zero. The number of times it could be …

  5. javascript - Sending a square root sign to a textarea - Stack Overflow

    √ is the html encoding of the square root symbol. This bit of javascript takes adds the √ symbol to whatever was already in the text area (not sure, but my guess is you're writing a …

  6. What's the fastest way to square a number in JavaScript?

    What's the fastest way to square a number in JavaScript? function squareIt(number) { return Math.pow(number,2); } function squareIt(number) { return number * number; } Or some other …

  7. optimization - JavaScript Math.sqrt performance - Stack Overflow

    Fast inverse square root. If You are using the square root to normalize vectors for computer graphics, there is a bonkers approximation of the inverse square root that was originally used …

  8. Square-Rooting in Javascript calculator not showing up

    May 16, 2013 · I have been making a javascript calculator for a while and I can get all basic functions and the pow() function but I can't get it to do the Math.sqrt() function. I've had this …

  9. What's the best way in JavaScript to test if a given parameter is a ...

    Isn't this (Math.sqrt(number) % 1 === 0) basically enough? it just checks if the sqrt of the number is a whole number, if so, then it's a perfect square. Obviously, depending on what you want to …

  10. Is it possible to display numbers inside a square root symbol in …

    Jun 11, 2020 · "--char" tells the CSS how many characters are contained in the square root to draw the top line the correct width. The overline is not generating in white, but will outside of …