Dismal Arithmetic & 3 Progs for 49G & Others
04-21-2015, 04:18 PM (This post was last modified: 09-08-2022 06:14 AM by Gerald H.)
Post: #1
 Gerald H Senior Member Posts: 1,627 Joined: May 2014
Dismal Arithmetic & 3 Progs for 49G & Others
Dismal arithmetic was invented to help less proficient arithmeticians to achieve easier results. There are two operations, addition & multiplication.

Addition is no-carry & the sum of two digits is the larger of the two.

eg 123456789 + 987654321 = 987656789

Multiplication is no carry & the product of two digits is the lesser of the two.

eg 12345678901 * 7 = 12345677701

The first few dismal squares are:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, 111, 112, 113, 114, 115, 116, 117, 118, 119, 200, 211....

For more see:

http://oeis.org/A087019

https://oeis.org/wiki/Dismal_arithmetic

http://arxiv.org/pdf/1107.1130.pdf

Two programmes for the HP 49G; DPLUS accomplishes dismal addition of two positive integers & DMULT the dismal multiplication of two positive integers.

DPLUS

Code:
::   CK2&Dispatch   # FFFF   ::     NULL$3UNROLL FPTR2 ^Z>S xSREV SWAP FPTR2 ^Z>S xSREV OVERLEN$     OVERLEN$#MIN #1+_ONE_DO DUP CDR$     SWAP     CAR$ROTDUP CDR$     3UNROLL     CAR$2DUP#< ?SWAPDROP 4ROLLSWAP >H$     3UNROLL     LOOP     &$xSREV SWAP&$     FPTR2 ^S>Z   ; ;

DMULT

Code:
::   CK2&Dispatch   # FFFF   ::     DUP     PTR 2F3A3     COERCE     DUP#0=csedrp     FPTR2 ^2DROPZ0     Z0_     4UNROLL     #1+_ONE_DO     Z10_     FPTR2 ^ZDIVext     3PICKSWAP     NULL$3UNROLL FPTR2 ^Z>S CAR$     SWAP     FPTR2 ^Z>S     SWAP     OVERLEN$#1+_ONE_DO DUPROT DUP CAR$     SWAP     CDR$4UNROLL 2DUP#> ?SWAPDROP 4ROLLSWAP >T$     3UNROLL     LOOP     2DROP     FPTR2 ^S>Z     4ROLL     ID DPLUS     SWAPROT     Z10_     FPTR2 ^RMULText     SWAPLOOP     2DROP   ; ;

I eagerly await the appearance of some dismal arithmetic programmes on the Prime.
 « Next Oldest | Next Newest »

 Messages In This Thread Dismal Arithmetic & 3 Progs for 49G & Others - Gerald H - 04-21-2015 04:18 PM RE: Dismal Arithmetic with Two Programmes for the HP 49G - Didier Lachieze - 04-21-2015, 09:19 PM RE: Dismal Arithmetic with Two Programmes for the HP 49G - Gerald H - 04-22-2015, 07:04 AM RE: Dismal Arithmetic with Two Programmes for the HP 49G - Didier Lachieze - 04-22-2015, 07:16 AM RE: Dismal Arithmetic with Two Programmes for the HP 49G - Didier Lachieze - 04-22-2015, 07:45 AM RE: Dismal Arithmetic with Two Programmes for the HP 49G - Dave Britten - 04-22-2015, 01:09 AM RE: Dismal Arithmetic with Two Programmes for the HP 49G - brouhaha - 04-22-2015, 01:18 AM RE: Dismal Arithmetic with Two Programmes for the HP 49G - Tugdual - 04-22-2015, 06:55 AM RE: Dismal Arithmetic with Two Programmes for the HP 49G - Gerald H - 04-22-2015, 08:54 AM RE: Dismal Arithmetic with Two Programmes for the HP 49G - Didier Lachieze - 04-22-2015, 09:56 AM RE: Dismal Arithmetic with Two Programmes for the HP 49G - Gerald H - 04-22-2015, 10:07 AM RE: Dismal Arithmetic with Two Programmes for the HP 49G & the Prime - Dave Britten - 05-06-2015, 05:34 PM RE: Dismal Arithmetic with Two Programmes for the HP 49G & the Prime & the HP 48S - Dave Britten - 05-07-2015, 01:48 PM RE: Dismal Arithmetic with Two Programmes 49G, the Prime, 48S & 32S - Gerald H - 05-07-2015, 03:25 PM RE: Dismal Arithmetic with Two Programmes 49G, the Prime, 48S & 32S - Gerald H - 05-07-2015, 03:57 PM RE: Dismal Arithmetic with Two Programmes 49G, the Prime, 48S & 32S - Gerald H - 05-07-2015, 04:59 PM RE: Dismal Arithmetic with Two Programmes 49G, the Prime, 48S & 32S - Dave Britten - 05-07-2015, 05:36 PM RE: Dismal Arithmetic with Two Programmes 49G, the Prime, 48S & 32S - Gerald H - 05-07-2015, 06:01 PM RE: Dismal Arithmetic with Two Programmes 49G, the Prime, 48S & 32S - Dave Britten - 05-08-2015, 01:35 AM RE: Dismal Arithmetic with Two Programmes 49G, the Prime, 48S & 32S - Dave Britten - 05-08-2015, 02:53 PM RE: Dismal Arithmetic & 2 Progs for 49G, the Prime, 48S & 32S & TI & C... - Dave Britten - 05-11-2015, 04:16 PM RE: Dismal Arithmetic & 2 Progs for 49G, the Prime, 48S & 32S & TI & C... - Marcus von Cube - 05-11-2015, 06:04 PM RE: Dismal Arithmetic & 3 Progs for 49G & Others - Gerald H - 05-13-2015, 09:19 AM RE: Dismal Arithmetic & 3 Progs for 49G & Others - Dave Britten - 05-13-2015, 05:59 PM RE: Dismal Arithmetic & 3 Progs for 49G & Others - Gerald H - 05-13-2015, 06:37 PM RE: Dismal Arithmetic & 3 Progs for 49G & Others - Dave Britten - 05-13-2015, 07:26 PM RE: Dismal Arithmetic & 3 Progs for 49G & Others - Gerald H - 10-28-2015, 02:17 PM RE: Dismal Arithmetic & 3 Progs for 49G & Others - Gerald H - 10-30-2015, 10:43 AM

User(s) browsing this thread: 1 Guest(s)