RE: Converting to and from FAC

From: COPLIN, Nicholas. (
Date: 2000-10-19 07:36:49

Hi Steve,
Thanks for the thorough description about going from 5byte to FP.

> To convert to a 5-byte fp number, basically you just reverse the steps
> (but how you do it will depend on how your numbers are represented).
> One possibility is to convert the numbers to binary and process them in
> binary; perhaps someone here will offer up a decent algorithm.
[COPLIN, Nicholas.] 
So working backwards using you proposal of converting to binary it seems
that shifting is useful to get the exponent, but I'm not sure about whether
I'm getting the binary mantissa correct for the digits right of the decimal

Take the number 10
10 is positive, therefore sign bit is 0
10 as a binary number is 1010
how many shifts needed for 1.xxxx gives exponent, ie 3 right shifts, +3
mantissa = 1.010 = 00100000 00000000 00000000 00000000 (drop 1, add sign)
exponent = 3+129 = 132 = 10000100

Take the number -0.5 (your example)
is negative, therefore sign bit is 1
as binary 0.101?
shift LEFT by 1, exponent = -1 +128 = $80
mantissa = ?

Any suggestions /corrections?


The contents of this email (including any attachments) may be
privileged and confidential. Any unauthorised use if the contents
is expressely prohibited. If you have received this email in error,
please advise us immediately (you can contact us by telephone
on +61 8 9441 2311 by reverse charge) and then permanetly
delete this email together with any attchaments. We appreciate
your co-operation.

Whilst Orbital endeavours to take reasonable care to ensure
that this email and any attachments are free from viruses or other
defects, Orbital does not represent or warrant that such are free from
computer viruses or other defects.

(C) 2000: Orbital Engine Company (Australia) PTY LTD and its
This message was sent through the cbm-hackers mailing list.
To unsubscribe: echo unsubscribe | mail

Archive generated by hypermail 2.1.1.