Jump to content

Double to hex


Recommended Posts

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 ;)

post-16131-124959320555_thumb.jpg

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.

post-16131-124959314056_thumb.jpg

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.

post-16131-124959348103_thumb.jpg

Hugs,

memoryleak

Link to comment

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.

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.