amarante68 Posted December 21, 2005 Report Share Posted December 21, 2005 Hi This is an issue I never went trough completly. Converting Float to Byte. I have to read AILRON_DEFLECTION ofset 2EA8. As other interesting values this one is a Float64. What is the math. to convert into a Byte or a Word? FSUIPC_READ_12=165,D?,2EA8 Thanks Link to comment Share on other sites More sharing options...
Pete Dowson Posted December 21, 2005 Report Share Posted December 21, 2005 Converting Float to Byte. Er, the range of a byte is -128 to +127. The range of a float exceeds than by trillions in both the itegral and fractional directions. There's really no way unless you know the float's value is within that very very small range. I have to read AILRON_DEFLECTION ofset 2EA8.As other interesting values this one is a Float64. What is the math. to convert into a Byte or a Word? It can't be done that easily. A Float64 has a number of bits as an exponent and the rest of the bits as mantissa, normalised so that there's one integral digit (i.e. 1). The bit assignments are documented in Intel technical specs. I can fish them out if you like, but there's no easy conversion. If you write in a decent language like C/C++ then the compiler will convert for you using the appropriate floating point register to fixed posint register transfer instructions. Regards, Pete Link to comment Share on other sites More sharing options...
Ron Buchwald Posted December 23, 2005 Report Share Posted December 23, 2005 Hi Just my two cents worth... try FS Communactor by robert fisher...it will convert or scale the float numbers for you and it does a LOT MORE.. ron. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now