Last active
April 25, 2024 10:56
-
-
Save kylemsguy/e37c98b49b5015e8cb1c31ad03fc016c to your computer and use it in GitHub Desktop.
[PRIFACTR.8xg] Prime factorization program for TI-83+/84+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Input "NUM:",M | |
If fPart(M | |
Then | |
Disp "ERR: NUM IS NOT INT" | |
Stop | |
End | |
0->C | |
2->T | |
M->I | |
While I>1 and T<sqrt(M | |
I/T->I | |
If fPart(I | |
Then | |
If C>0 | |
prgmPRNTFCTR | |
0->C | |
If T=2 | |
Then | |
3->T | |
Else | |
T+2->T | |
End | |
Else | |
C+1->C | |
End | |
End | |
If not(I=1 | |
Then | |
1->C | |
I->T | |
End | |
prgmPRNTFCTR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
T->N | |
prgmZNUM2STR | |
Str1->Str2 | |
C->N | |
prgmZNUM2STR | |
Disp Str2+"^"+Str1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"? | |
For(X,1,1+log(N+not(N | |
sub("0123456789",iPart(10fPart(N10^(-X)))+1,1)+Ans | |
End | |
sub(Ans,1,length(Ans)-1->Str1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ZNUM2STR taken from http://tibasicdev.wikidot.com/number-to-string2