Number Concatenation

We're glad you came by, but you might find what you're looking for elsewhere.

TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it.

Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope.

Routine Summary

Concatenates two whole numbers together.

Inputs

M - the first number
N - the second number

Outputs

O - the concatenated number

Variables Used

M, N, O

Calculator Compatibility

TI-83/84/+/SE

Author

DarkerLine

URL: United TI

Download

numberconcatenation.zip

:N+M10^(1+int(log(N→O

With our two numbers stored in M and N respectively, we add the first number to the second number by raising it to the 10th power, with the exponent being how many digits are in the number. We then store this result to a new variable for later use.

We can figure out how many digits are in a number by using the 1+int(log( trick. This trick works with any positive whole numbers, and if you add abs( after log(, it will also work with negative numbers. Unfortunately, it does not work with decimals.

.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.