I made a thing. 'What's that thing?' you may ask? It's Based, the newest and best1 base converter for the TI-84 Plus CE! Unlike those other base converters, Based allows you to convert from any base to any base2 3 4 5.

Initially, I wanted to make a program that does many binary operations because I've been playing around with a binary number system I saw, so obviously I had to make a program to convert from base 10 to binary. I figured that I might as well make one to convert an arbitrary base to another arbitrary base. Eventually, I finally finished (most of the time was devoted to fixing bugs), and now it seems that Based works correctly.

Features: Based allows for conversion between any two bases between 2 and 32. When you open the program, you are greeted by a single colon. To specify a number, base to convert to, base to convert from, and how many decimal numbers you want, you just separate each by colons. For instance, to convert 4F.4 from hexadecimal to binary with 5 digits after the decimal, enter 4F.4:2:16:5. To prevent you having to reenter the same arguments every time, the program will remember your previous base, base to convert into, and number of digits after the decimal. If you enter a character incompatible with the base you specified, the program will return to the initial prompt, however if you do not specify a base to convert from in the prompt, the program will assume it to be base 10 if all digits are 0 through 9, base 16 if the largest digit correlates to less than 16, or base 32 if the largest digit correlates to less than 32. If not provided a base to convert into, the program will assume binary, and if not provided how many digits to put after the decimal, it will default to 10. To exit the program, enter X.

Problems: When I was making this, it was rife with bugs. There is almost a zero percent chance I got all of them. If you find one, please let me know. The program will also struggle with floating point errors (I think). For instance, logBASE(16,2) equals 4, but int(logBASE(16,2)) actually equals 3. After looking at the number in a hex editor, logBASE(16,2) actually gives an answer of 3.999999999999999... and using the int( command cuts off all those nines. To fix it, I added 10-8 to the log value before I use int(. It's possible that this may lead to other errors, but any calculation should (hopefully) be close enough. Some floating point error is still present in 1.3333333333...:3:10 where it give 1.0222222222... instead of 1.1.

1 according to me
2 as long as the base is positive
3 and an integer
4 and greater than 1
5 and less than 33
Quote:
Unlike those other base converters, Based allows you to convert from any base to any base [...] I figured that I might as well make one to convert an arbitrary base to another arbitrary base, as I had not seen that.

Base 2 to 36: https://www.cemetech.net/downloads/files/216/x3019 But even if you had run across that, I support exercising your skills by creating it! In particular, it sounds like you created an interface that is very fast to use for the knowledgeable user, without having to navigate prompts or repeatedly hit enter to select the to/from base. Do you have any screenshots? Is this in TI-BASIC or C?
Also Base 2 to 36 (with a UI similar to the homescreen): https://www.cemetech.net/downloads/files/1641/x1641

I mostly used the routines from our routines thread for this program (check the bottom of the initial post in this thread) and they mostly resolve both of your problems without using the logBASE token which is only available in calcs older than 2.53 mathprint (and which has problems that you've already noticed!)
KermMartian wrote:
Quote:
Unlike those other base converters, Based allows you to convert from any base to any base [...] I figured that I might as well make one to convert an arbitrary base to another arbitrary base, as I had not seen that.

Base 2 to 36: https://www.cemetech.net/downloads/files/216/x3019 But even if you had run across that, I support exercising your skills by creating it! In particular, it sounds like you created an interface that is very fast to use for the knowledgeable user, without having to navigate prompts or repeatedly hit enter to select the to/from base. Do you have any screenshots? Is this in TI-BASIC or C?

Yeah, right after I finished this I looked again and I saw that lol. Originally the post said that I hadn't seen any others that converted between arbitrary bases, so I removed that. I didn't post screenshots initially because it is incredibly basic in terms of GUI. It is in pure BASIC. I might rework it in hybrid BASIC since that would let me make it much smaller, but I wanted to make it as easy as possible to use.

The first image is what you see when you open the program. The second is after you do a calculation.

I forgot to mention that the program doesn't clear the homescreen, and it also saves the answer to Str0 so that you can recall it if you need to.

iPhoenix wrote:
they mostly resolve both of your problems without using the logBASE token which is only available in calcs older than 2.53 mathprint (and which has problems that you've already noticed!)

I didn't know that the logBASE( function wasn't in older calculators. If I do end up making a hybrid BASIC version, I'll probably try to update this one for older calcs.

I also think that I could make a truly arbitrary base converter without too much trouble (of course I thought making this program wouldn't be too much trouble until all the bugs came around). It wouldn't use single characters for all digits, but maybe something like 63_100 referring to the centennial digit for 63. I also think I may be able to generalize the processes used in the program to the reals, and maybe even the negatives. I'll have to do some research though.

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.

»
» 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