Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Modular-inverse/Minimal-BASIC/modular-inverse.basic
Normal file
19
Task/Modular-inverse/Minimal-BASIC/modular-inverse.basic
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
10 REM Modular inverse
|
||||
20 LET E = 42
|
||||
30 LET T = 2017
|
||||
40 GOSUB 500
|
||||
50 PRINT M
|
||||
60 END
|
||||
490 REM Calculate modular inverse
|
||||
500 LET D = 0
|
||||
510 IF E >= T THEN 600
|
||||
520 LET B = E
|
||||
530 LET C = 1
|
||||
540 LET S1 = INT((T-B)/E)+1
|
||||
550 LET B = B+S1*E
|
||||
560 LET C = C+S1
|
||||
570 LET B = B-T
|
||||
580 IF B <> 1 THEN 540
|
||||
590 LET D = C
|
||||
600 LET M = D
|
||||
610 RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue