Standard basic standard TI

Are numeric variables following the documented standard for TI calculators?

I was very surprised to notice in my TI 83 Premium CE that this test actually returns true (i.e. 1):

0,1 → X

0,1 → Y

0.01 → Z

X * Y = Z

I expected this to fail if my calculator uses something like the IEEE 754 standard to represent floating point numbers.

On the other hand, calculating 2 ^ 50 + 3-2 ^ 50 returns 0, showing that large integers use this standard: here a large number has a limited mantissa.

+5
source share
1 answer

TI-BASIC = is a tolerant comparison

Try 1+10^-12=1 on your calculator. These numbers are not represented equally ( 1+10^-12-1 gives 1E-12 ), but you will notice that the comparison returns true: because = has a certain tolerance. AFAICT from testing on my calculator, if the numbers are equal when rounding to ten significant digits, = will return true.

Secondarily

TI-BASIC uses its own BCD float format

TI floats are a BCD format that is nine bytes long, with one byte for sign and auxiliary information and 14 digits (7 bytes) of precision. The ninth byte is used for extra precision, so numbers can be rounded correctly.

See the source related to @doynax here for more details.

+3
source

Source: https://habr.com/ru/post/1236841/


All Articles