(12C) Square Root
|
12-23-2023, 04:26 AM
Post: #10
|
|||
|
|||
RE: (12C) Square Root
(12-23-2023 01:48 AM)Dave Hicks Wrote: Interesting algorithm! This is the good old digit by digit method. Here's a program for the HP-42S: Code: 00 { 50-Byte Prgm } Example 10 XEQ "√" y: 30 x: 100 R/S y: 310 x: 3900 R/S y: 3160 x: 14400 R/S y: 31620 x: 175600 R/S y: 316220 x: 4911600 R/S y: 3162270 x: 48447100 But we can do better using David Cochran's trick, multiplying the number by 5. Therefore we only have to keep track of the subtrahend. We just ignore the trailing 5 in the result. Code: 00 { 45-Byte Prgm } Example 10 XEQ "√" y: 305 x: 500 R/S y: 3105 x: 19500 R/S y: 31605 x: 72000 R/S y: 316205 x: 878000 R/S y: 3162205 x: 24558000 R/S y: 31622705 x: 242235500 This method is used in most HP calculators. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(12C) Square Root - Gamo - 10-02-2019, 10:23 AM
RE: (12C) Square Root - Albert Chan - 10-02-2019, 02:36 PM
RE: (12C) Square Root - Albert Chan - 09-28-2020, 05:18 PM
RE: (12C) Square Root - Albert Chan - 09-28-2020, 07:14 PM
RE: (12C) Square Root - Gamo - 10-03-2019, 02:01 AM
RE: (12C) Square Root - SlideRule - 09-28-2020, 09:45 PM
RE: (12C) Square Root - Albert Chan - 06-08-2021, 03:36 PM
RE: (12C) Square Root - depor - 12-21-2023, 11:50 PM
RE: (12C) Square Root - Dave Hicks - 12-23-2023, 01:48 AM
RE: (12C) Square Root - Thomas Klemm - 12-23-2023 04:26 AM
|
User(s) browsing this thread: 1 Guest(s)