PDA

View Full Version : floting point variables?????



kasapo
- 2nd March 2005, 13:03
hi,

do you know the size of aint and bint which are used in fp ? word, byte??


aint = 30000
Gosub itofa ' Convert int to float

bint = 2045
Gosub itofb ' Convert int to float

Gosub fpmul ' FP multiply
gosub ftoia /' here we get a 24 bit result

when we convert it we get aint and how can we use it in the rest of the program ? can we equate it to 2 words ?

Darrel Taylor
- 3rd March 2005, 00:59
The aint variable is WORD sized. To get a larger number back from FP routines. Divide the result by 65536 to get the High Word. This is done before converting to an integer.

HTH,
   Darrel

Darrel Taylor
- 3rd March 2005, 01:43
I should probably mention that if you're using the 24bit FP routines, then it's really only 16bit with an 8bit mantisa. To do what you had originally stated in the other thread, you should be using the 32bit version of the FP routines.

Darrel