Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
27
Task/Modular-inverse/Tiny-BASIC/modular-inverse-2.basic
Normal file
27
Task/Modular-inverse/Tiny-BASIC/modular-inverse-2.basic
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
REM Modular inverse
|
||||
LET E=42
|
||||
LET T=2017
|
||||
GOSUB 100
|
||||
PRINT M
|
||||
END
|
||||
|
||||
REM Increments E S (step) times until B is greater than T
|
||||
REM Repeats until B = 1 (MOD = 1) and C (count)
|
||||
REM B will not be greater than T + E
|
||||
100 LET D=0
|
||||
IF E>=T THEN GOTO 130
|
||||
LET B=E
|
||||
REM At least one iteration is necessary
|
||||
LET S=((T-B)/E)+1
|
||||
LET B=B+S*E
|
||||
LET C=1+S
|
||||
LET B=B-T
|
||||
110 IF B=1 THEN GOTO 120
|
||||
LET S=((T-B)/E)+1
|
||||
LET B=B+S*E
|
||||
LET C=C+S
|
||||
LET B=B-T
|
||||
GOTO 110
|
||||
120 LET D=C
|
||||
130 LET M=D
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue