Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    integer division is slower than FP sqrt on current hardware. This idea has no chance. >.< Even in 2008, Core2's sqrtsd throughput is one per 6-58c. Its idiv is one per 12-36cycles. (latencies similar to throughputs: neither unit is pipelined). Commented Aug 21, 2015 at 2:22
  • sqrt doesn't need to be perfectly accurate. That's why you check by integer-squaring the result and doing an integer-compare to decide if the input integer had an exact integer sqrt. Commented Aug 21, 2015 at 2:23
  • 1
    This may not be the winner but I like it because it's a different approach. Commented Jun 19, 2021 at 22:07
  • Your solution to check if a number is square is to... factor it?? Do you know how hard factoring can be? Commented Aug 2, 2022 at 22:15