About 4,030 results
Open links in new tab
  1. python - Check if a number is a perfect square - Stack Overflow

    How could I check if a number is a perfect square? Speed is of no concern, for now, just working. See also: Integer square root in python.

  2. How to find out if a number is a perfect square without using sqrt ...

    Aug 1, 2019 · I have to write a program that finds out whether or not a number is a perfect square. The terms are I don't use a sqrt function or an exponent (**) I previously showed my teacher my solution …

  3. How do I find perfect square from a set of numbers in Java?

    Sep 24, 2019 · A perfect square is a number that can be expressed as the product of two equal integers so it must be an int after the sqrt. If you do a sqroot*sqroot == num you are just checking that sqrt is …

  4. Optimized way to find if a number is a perfect square

    I had a question in my assignment to find whether a number was perfect square or not: Perfect square is an element of algebraic structure which is equal to the square of another element. For ex...

  5. python - Finding perfect square - Stack Overflow

    So any positive value of x>1 will fullfil the ans*ans=1*1=1!=x, giving "x is not a perfect square". You basically needs to get your indentation right - like you do in your other example.

  6. finding the number of perfect squares in the given range

    Things are really simple here. Instead of looping from A to B and checking for perfect squares, we can calculate the first integer square root of A at O (1) and count the rest perfect squares with simple …

  7. java - Perfect square if,else - Stack Overflow

    Feb 2, 2013 · This is what he means by a perfect square: a perfect square like sqrt of 9=3 but false if the square root of that number is a decimal for example squareroot of 10 would be 3.122222.....

  8. Check for number of perfect pairs in array - Stack Overflow

    Dec 4, 2023 · After the transformation, each prime factor occurs no more than once in each number. Now notice that we only get perfect squares from products of identical numbers. For a number that …

  9. java - how can i check if the number is perfect square by not using ...

    Oct 27, 2022 · An integer that can be expressed as the square of another integer is called a perfect square, such as 4,9,16,25, etc. Write a progran that checks if a number is a perfect square.

  10. Python Perfect Square - Stack Overflow

    Jul 7, 2013 · I'm writing a function that takes a list L as a parameter and returns a list consisting of all the elements in L that are perfect squares. def isPerfectSquare(n): return n==int(math.sqrt(n))...