Mourad Posted August 6, 2009 Report Share Posted August 6, 2009 Hi all, Need little help about converting double number to hex for example; need to convert -0,35 and +0,35 to hex. Any ideas? Quote Link to comment
memoryleak Posted August 6, 2009 Report Share Posted August 6, 2009 Hi all, Need little help about converting double number to hex for example; need to convert -0,35 and +0,35 to hex. Any ideas? There's an App VI for that EDIT: Forgive me for being an idiot, I forgot some places use commas how I use decimals Try scaling your number by say, 100 (if you want two decimal places) and then doing two individual conversions to hex. Sadly I think you might have to do the sign with an additional operation/comparison. Additionally, if you want the raw hex from the number encoded as floating point, you can type cast it to a similarly wide data type (like U64) and do the conversion to hex using that number. Hugs, memoryleak Quote Link to comment
Mark Yedinak Posted August 10, 2009 Report Share Posted August 10, 2009 Strictly speaking you can't do what you are asking. A pure hexadecimal number is an integral value and cannot represent a fractional value. You can get the hex representation for the binary value of the double value but without knowing the internal representation of the value in terms of the mantissa and the exponent the hex value is rather meaningless. Quote Link to comment
jzoller Posted August 10, 2009 Report Share Posted August 10, 2009 Strictly speaking you can't do what you are asking. A pure hexadecimal number is an integral value and cannot represent a fractional value. You can get the hex representation for the binary value of the double value but without knowing the internal representation of the value in terms of the mantissa and the exponent the hex value is rather meaningless. http://zone.ni.com/reference/en-XX/help/371361E-01/lvconcepts/how_labview_stores_data_in_memory/ IEEE standard. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.