471,354 Members | 1,284 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

How to get the hex string of a floating point number?

How to get the hex string of a double floating point number (internal 8 bytes)?
Jan 2 '06 #1
2 3554
How to get the hex string of a double floating point number (internal 8 bytes)?


Something like
BitConverter.DoubleToInt64Bits(yourDoubleValue).To String("X")
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 2 '06 #2
nick <ni**@discussions.microsoft.com> wrote:
How to get the hex string of a double floating point number (internal 8 bytes)?


Use BitConverter.DoubleToInt64Bits to represent the double as a long,
and then format the long as a hex string using the 'X' format
specifier.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jan 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by ken | last post: by
5 posts views Thread by Bryan R. Meyer | last post: by
15 posts views Thread by michael.mcgarry | last post: by
32 posts views Thread by ma740988 | last post: by
2 posts views Thread by ghjk | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.