Nov 22, 2012 at 4:04 PM
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
Pronouns: he/him
Consider Cave Story. Now consider floats, very large integers, and complex numbers.
How?
Consider your basic 32-bit integer. Or even a 16-bit integer.
Using integers, it is possible to construct a floating point number.
We only have to use Noxid's <VAR or TSC+ hack, which already exists.
Since the <VAR hack allows us to use integers in TSC and makes TSC much more Turing complete than it was before, it is easy to set up floats.
Floats are pairs of integers. Floats have a value and an exponent:
(1, -3) = 1 * 10 ^ -3 = 1e-3 = 0.001
Or how about...
(314159265, -8) = 314159265 * 10 ^ -8 = 3.14159265
We can also do:
(2, 100) = 2 * 10 ^ 100 = 2 * (a googol)
Notice that with our pair system, we can suddenly represent:
By adding in more integers, you can have arbitrary length integers (known in Java as BigIntegers) as well.
Once again, you can write all of this functionality in TSC as long as you have decent comparison operators as well as some form of if statement that can accept compares on integers.
(If you are wondering why regular floats only allow 7 digits of precision while our system offers 9 or 10, it is because regular floats are lame and use up a few bits for infinity, negative infinity, negative 0, and especially the whole slew of NaN (not a number). Plus we are going for two integers instead of just one 32-bit value. We have far more exponents to choose from.)
- Floats: floats are real numbers. In other words, they include all the numbers starting from negative infinity to positive infinity exclusive. They cover every rational number and every integer, and then some. Floats are numbers represented with a decimal point, such as 3.6, 5.12, 3.1415926..., or 18.0.
- Large Integers: Whole numbers greater than 2 to the power of 32.
- Complex Numbers: complex numbers are pairs of floats. They have one real and one imaginary part. Examples include 3.1 + 5.8i, 15.676 - 32.256777i, and 3.0 + 999.0i.
How?
Consider your basic 32-bit integer. Or even a 16-bit integer.
Using integers, it is possible to construct a floating point number.
We only have to use Noxid's <VAR or TSC+ hack, which already exists.
Since the <VAR hack allows us to use integers in TSC and makes TSC much more Turing complete than it was before, it is easy to set up floats.
Floats are pairs of integers. Floats have a value and an exponent:
(1, -3) = 1 * 10 ^ -3 = 1e-3 = 0.001
Or how about...
(314159265, -8) = 314159265 * 10 ^ -8 = 3.14159265
We can also do:
(2, 100) = 2 * 10 ^ 100 = 2 * (a googol)
Notice that with our pair system, we can suddenly represent:
- Any floating point number, to 9 or 10 decimal places (32-bit integers have a maximum of 10 decimal digits).
- Very large numbers such as 2 * googol, as long as we don't care about the least significant decimal digits (the ones on the right side of the number).
By adding in more integers, you can have arbitrary length integers (known in Java as BigIntegers) as well.
Once again, you can write all of this functionality in TSC as long as you have decent comparison operators as well as some form of if statement that can accept compares on integers.
(If you are wondering why regular floats only allow 7 digits of precision while our system offers 9 or 10, it is because regular floats are lame and use up a few bits for infinity, negative infinity, negative 0, and especially the whole slew of NaN (not a number). Plus we are going for two integers instead of just one 32-bit value. We have far more exponents to choose from.)