This forum might not belong in this forum category, but I tried finding the best one I though this post could fit in, and I ask the moderators, etc. to please keep this here until I can fully understand the answers to these questions (if I get any answers)... please.

I know that “0x5” means “lol”, or technically “101”, but I heard somewhere that “0x5” is some type of base. Do you know what type of base it is, and if you do, will you please tell me?
Also, how would I go about making a TI-BASIC program that could convert that base (like “0x5”) to text/numbers (like “101”)?

So, all I’m basically asking is what base is it, and how would I be able to convert that base to text/numbers and vice-versa?

Thanks!
0x means that the following number is in base 16, which is also known as hex or hexadecimal. You can use Kerm's base converter program to convert between any two bases.

Since you don't have a computer, I'll post the code as text here:

Code:
:DCS
D4BAD8F4E2D8B5E8
Lbl A
Menu("BASECONV 1.0","CONVERT",1,"HELP",H,"QUIT",Q
Lbl 1:ClrHome
Input "FROM BASE…",A
Input "…TO BASE…",B
If A=int(A) and B=int(B) and A<37 and B<37 and A>1 and B>1
Then
Input "CONVERT:",Str0
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ →Str1
DelVar D1→E
Repeat E>length(Str0
D+A^(E-1)(⁻1+inString(Str1,sub(Str0,length(Str0)-E+1,1))→D
E+1→E:End
".→Str0
While D
D/B→D
sub(Str1,int(BfPart(D))+1,1)+Str0→Str0
int(D)→D
End:Pause sub(Str0,1,length(Str0)-1
Else
Disp "BASES MUST BE
Pause "1 TO 36 ONLY
End
Goto A:Lbl H
ClrHome
Disp "ENTER BASE TO","CONVERT TO AND","FROM, 1 TO 36.
Pause "WWW.CEMETECH.NET
Goto A:Lbl Q
ClrHome
Disp "BASECONV 1.1","BY KERM MARTIAN


Basically, when a number is in base n, the value of the number is its last digit, plus n times its second from last digit, plus n^2 times its third from last digit, and so on. So 0x123 would be 3 + 2 * 16 + 1 * 16^2 = 291. In bases greater than 10, you would need a digit larger than 9, so letters are used starting at A=10. So 0xF = 15, and 0xFF = 15 + 16 * 15 = 255.

0x5 is actually equal to 5 in base 10, but 101 in binary or base 2 (also sometimes written as 0b101).

EDIT: MufinMcFlufin also wrote this, which might be easier to type (from the code fragments page):
Inputs:
N = Base to convert from
M = Base to convert to
Str1 = Number to convert
Outputs:
Str1 & Ans = Converted number

Code:

sum(seq(N^A,A,length(Str1)-1,0,~1)seq(inString(sub("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",1,N),sub(Str1,A,1)),A,1,length(Str1->B
Pause B
seq(0,A,1,int(log(B)/log(M->L1
While B
int(log(B)/log(M->C
int(BM^~Ans->L1(dim(L1)-Ans+1
B-AnsM^C->B
End
" ->Str1
For(A,1,dim(L1
Str1+sub("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",1+L1(A),1->Str1
End
DelVar L1sub(Str1,2,length(Str1)-1->Str1
commandblockguy wrote:
0x means that the following number is in base 16, which is also known as hex or hexadecimal. You can use Kerm's base converter program to convert between any two bases.

Since you don't have a computer, I'll post the code as text here:

Code:
:DCS
D4BAD8F4E2D8B5E8
Lbl A
Menu("BASECONV 1.0","CONVERT",1,"HELP",H,"QUIT",Q
Lbl 1:ClrHome
Input "FROM BASE…",A
Input "…TO BASE…",B
If A=int(A) and B=int(B) and A<37 and B<37 and A>1 and B>1
Then
Input "CONVERT:",Str0
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ →Str1
DelVar D1→E
Repeat E>length(Str0
D+A^(E-1)(⁻1+inString(Str1,sub(Str0,length(Str0)-E+1,1))→D
E+1→E:End
".→Str0
While D
D/B→D
sub(Str1,int(BfPart(D))+1,1)+Str0→Str0
int(D)→D
End:Pause sub(Str0,1,length(Str0)-1
Else
Disp "BASES MUST BE
Pause "1 TO 36 ONLY
End
Goto A:Lbl H
ClrHome
Disp "ENTER BASE TO","CONVERT TO AND","FROM, 1 TO 36.
Pause "WWW.CEMETECH.NET
Goto A:Lbl Q
ClrHome
Disp "BASECONV 1.1","BY Kerm MARTIAN


Basically, when a number is in base n, the value of the number is its last digit, plus n times its second from last digit, plus n^2 times its third from last digit, and so on. So 0x123 would be 3 + 2 * 16 + 1 * 16^2 = 291. In bases greater than 10, you would need a digit larger than 9, so letters are used starting at A=10. So 0xF = 15, and 0xFF = 15 + 16 * 15 = 255.

0x5 is actually equal to 5 in base 10, but 101 in binary or base 2 (also sometimes written as 0b101).

EDIT: MufinMcFlufin also wrote this, which might be easier to type (from the code fragments page):
Inputs:
N = Base to convert from
M = Base to convert to
Str1 = Number to convert
Outputs:
Str1 & Ans = Converted number

Code:

sum(seq(N^A,A,length(Str1)-1,0,~1)seq(inString(sub("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",1,N),sub(Str1,A,1)),A,1,length(Str1->B
Pause B
seq(0,A,1,int(log(B)/log(M->L1
While B
int(log(B)/log(M->C
int(BM^~Ans->L1(dim(L1)-Ans+1
B-AnsM^C->B
End
" ->Str1
For(A,1,dim(L1
Str1+sub("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",1+L1(A),1->Str1
End
DelVar L1sub(Str1,2,length(Str1)-1->Str1


EDIT 1: What does the ‘~’ mean in the shorter base converter? I get an error when using it, and selecting the Goto error goes to this code:
:sum(seq(N^A,A,length(Str1)-1,0,~1)seq(inString(sub("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",1,N),sub(Str1,A,1)),A,1,length(Str1->B
I made sure I used the sto -> token, and didn’t type ‘->’, which I know would throw an error... also, I don’t know what the ‘~’ means or stands for, so I didn’t try using it in the code on-calc (yes, I can get that character since I have prgmCHARZ by KermMartian on my calc).


YES!!! Thank you so much, commandblockguy!!
I appreciate you taking thr time to explain each of the 2 programs/code, and taking the time to even put the code here, and not linking a download or something!!!
Thanks for doing that, since I don’t have a computer!

I DO have a pc, a Windows 10 laptop, but my grandparents won’t let me have it (I’m 17, and they still have control over it, since they bought it for me), but I can’t have it because:
1.) We’ve had it boxed up since we moved, a year ago, but
2.) It apparently “wouldn’t work” (said my grandparents and my brother’s dad) because it “didn’t have the Microsoft account set up properly”, which is false, it does work without it.
3.) My brother’s dad had looked through my pc completely, and found some explicit/adult language on some kind of website, what it’s called, I don’t know.

But my brother’s dad thinks he’s a “professional” when it comes to computers. He said he could bypass the login, without knowing the username and password, with a usb drive and some kind of file on it.
Now, I know he CAN put “any” kind of Windows OS on any windows pc, as I’ve seen him fix a windows 8 pc by reinstalling windows 8 os on it... but I really doubt he could install ANY win-os on a win-pc...
He's probably talking about Ophcrack. I've used it a few times before, and if the password is short enough you can definitely use it to get passwords off of a Windows computer.
Reinstalling Windows also isn't that hard. You basically just get a DVD or flash drive with Windows on it, boot the computer of it, and follow the instructions on-screen. You also don't need a Microsoft account to use a Windows PC (last I checked, anyway - who knows what Microsoft is up to now).
TimmyTurner62 wrote:

EDIT 1: What does the ‘~’ mean in the shorter base converter? I get an error when using it, and selecting the Goto error goes to this code:
:sum(seq(N^A,A,length(Str1)-1,0,~1)seq(inString(sub("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",1,N),sub(Str1,A,1)),A,1,length(Str1->B
I made sure I used the sto -> token, and didn’t type ‘->’, which I know would throw an error... also, I don’t know what the ‘~’ means or stands for, so I didn’t try using it in the code on-calc (yes, I can get that character since I have prgmCHARZ by KermMartian on my calc).


~ is the (-) negation key
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement