News for hackers. Stuff that matters.
Re:The Lost Art of Manually Calculating Square Roots by chirau on Thursday July 13, 2017 @10:22AM (#14761454)
How is this a 'lost art'? I had to do this in college. Didn't we all?
Re:The Lost Art of Manually Calculating Square Roots by deathanatos on Thursday July 13, 2017 @11:39AM (#14762196)
I never formally learned any algorithm for performing square roots in either high school or college. In the few cases that I've needed one, I've simply binary searched out the answer to the required precision, and called it a day.
Re:The Lost Art of Manually Calculating Square Roots by pps43 on Thursday July 13, 2017 @11:59AM (#14762393)
Your approach is equivalent to the one described in the article, the only difference is that they use base 10 instead of base 2.
Re:The Lost Art of Manually Calculating Square Roots by schoen on Thursday July 13, 2017 @01:23PM (#14763177)
I think deathanatos meant binary search as in

https://en.wikipedia.org/wiki/Binary_search_algorithm

rather than representing numbers or performing arithmetic in base 2.

Re:The Lost Art of Manually Calculating Square Roots by pps43 on Thursday July 13, 2017 @01:38PM (#14763355)
If you perform the algorithm described in the article in base 2 rather than base 10, you'll get binary search. Instead of (10 A) do (2 A), etc. Each step is easier (no guessing and checking), but there are more steps because each step gives you one bit rather than one decimal digit.
Re:The Lost Art of Manually Calculating Square Roots by placeybordeaux on Thursday July 13, 2017 @03:53PM (#14764598)
I guess thats a form of binary search, however thats not what I was thinking. For example:

sqrt(7720.17)

first guess 50:

2500

Go up

second guess 100:

10000

too high go down

third guess 75

5625

too low go up

fourth guess 86 (for ease of calculation)

6400 480 + 480 36

7396

too low go up: 93

8529

too high go down: 90

8100

too high go down: 88

7744

Etc.

It's not a great method, but it's what first came to mind. I do it sometimes in my head for a quick estimate.

Re:The Lost Art of Manually Calculating Square Roots by pps43 on Thursday July 13, 2017 @05:14PM (#14765310)
It works the same way.

7720 in binary is 1111000101000. This is 13 bits. Square root is at most half as long, so first guess is 10000000 in binary, or 128.

Square that, realize that it's too high, set the highest bit to 0 and next bit to 1.

Square 1000000 binary or 64, realize that it's too low. Keep the top bit, raise the next bit.

Square 1100000 binary or 96, too high, drop that bit back to zero, raise the next bit.

Square 1010000 binary or 80, too low, raise the next bit.

Square 1011000 binary or 88, too high, drop this bit and raise the next one.

Square 1010100 binary or 84, too low, raise the next bit.

Square 1010110 binary or 86, too low, raise the next bit.

Got 1010111 binary or 87.

Re:The Lost Art of Manually Calculating Square Roots by schoen on Friday July 14, 2017 @12:47PM (#14771199)
It's awesome to see how binary representation of numbers often leads to a convergence between operations and algorithms conceived in terms of arithmetic and those conceived in terms of logic.
Re:The Lost Art of Manually Calculating Square Roots by zacharycohn on Thursday July 13, 2017 @11:58AM (#14762387)
Nope. In fact, I distinctly remember one of my earlier frustrations of high school was asking the teacher how to do square roots. She said "with a calculator." "Yeah yeah, but how to do you do them by hand?" "You don't, you just need to use the calculator."

I've never heard of anyone below the age of 30 learning in school how to do them manually.

Re:The Lost Art of Manually Calculating Square Roots by steaknsteak on Thursday July 13, 2017 @11:06AM (#14761875)
I graduated college a year ago and I'm not sure if I've ever in my life been asked to manually compute a square root (except for a perfect square integer).
Re:The Lost Art of Manually Calculating Square Roots by yazan94 on Thursday July 13, 2017 @11:21AM (#14762027)
Same here. And I distinctly remember asking a math teacher in middle school if a number was a perfect square and we manually ended up checking and incrementing numbers until we decided that the number was not. It makes me think that this was possibly not such a common task to assign in school?
Re:The Lost Art of Manually Calculating Square Roots by dmoy on Thursday July 13, 2017 @11:37AM (#14762172)
Depends on your course load. My EE courses forced you to do this (and then forced you to do it in hardware... on a crappy chip that I swear lacked an overflow bit, but my memory is fuzzy).
Re:The Lost Art of Manually Calculating Square Roots by tjr on Thursday July 13, 2017 @10:52AM (#14761737)
I sometimes relax my mind and drift off to sleep by doing basic square root calculations in my head.
Re:The Lost Art of Manually Calculating Square Roots by jameskilton on Thursday July 13, 2017 @10:24AM (#14761473)
I graduated highschool in 2002 and college in 2006. I've never done square roots by hand or even seen how it would be done until now.
Re:The Lost Art of Manually Calculating Square Roots by breadbox on Thursday July 13, 2017 @03:15PM (#14764277)
Definitely not (and I went to college when I was one of the few students who arrived with his own computer). Our chemistry teacher spent one class showing us how to use Newton's approximation, and most students found it a complete waste of time, given that everybody had a pocket calculator of some kind.

(Of course, I learned how to calculate square roots on paper before I went to college, but only because I asked my father to show me how.)

Re:The Lost Art of Manually Calculating Square Roots by cavDXF on Thursday July 13, 2017 @10:49AM (#14761698)
I did. (as a millenial) I didn't even study a subject connected to mathematics. I came across it and thought it was neat, so i learned it... but forgot it.
Re:The Lost Art of Manually Calculating Square Roots by abritinthebay on Thursday July 13, 2017 @12:15PM (#14762544)
37 here - god no. I think it was mentioned that you could but other than knowing it was possible I’ve never seen anyone do it.
Re:The Lost Art of Manually Calculating Square Roots by BenjiWiebe on Friday July 14, 2017 @11:58AM (#14770797)
I went to a parochial school. I think I learned it in 5th grade. Or 6th.
Re:The Lost Art of Manually Calculating Square Roots by agjacobson on Thursday July 13, 2017 @12:39PM (#14762760)
Grade school. 6th grade. PS241 Brooklyn

nyah!