Re: LZ: Real number format


[Prev][Next][Index][Thread]

Re: LZ: Real number format



Kari Brown wrote:
> 
> Few weeks ago, there was a discussion about the TI-85
> real number format. It seems like I've lost all those
> messages. I would really appreciate it, if anyone could
> explain me how the values of the second and third bytes
> of the package are calculated. I've read the 85n.txt but
> it is still a mystery for me.
> 
> 00 00 FC 31 41 59 26 53 58 98
> |  |__|  |__________________|
> |  |     |
> |  |     Value (3.141...) as BCD
> |  ?
> |
> Sign(+)
The first byte is the sign,00 for positive numbers and 80 for 
negative numbers. The two next bytes are the exponent of the number.
The formular to calc the exponent from the two bytes is:
[1]+256d*([2]-FC)
Where [1] is the first byte and [2] is the second byte. The next values 
are the digits in packet BCD.
so

123  = 00 02 FC 12 30 00 00 00 00 00
-123 = 80 02 FC 12 30 00 00 00 00 00
Pi   = 00 00 FC 31 41 59 26 53 58 98
       |  |___| |__________________|The value as packet BCD
       |  The exponent (00+256*d(FC-FC)=0)
       The sign (+)
-- 
_______________________________________

Dines Justesen
Email: dines@post1.com or
       c958362@student.dtu.dk
WWW  : http://www.gbar.dtu.dk/~c958362/
_______________________________________


References: