C # BitConverter.GetBytes (float / double) format?

What output format does "BitConverter.GetBytes" generate? Does it generate: IEEE standard for normalizing single / double precision floating point number I need to know this as I am writing an XDR message and as described in RFC 1014 3.6 and 3.7 use the IEEE standard.

+2


source to share


2 answers


Yes, this is IEEE. See here . The specificity may differ from system to system as it is not part of the IEEE 754 specifications. You can check this with BitConverter.IsLittleEndian

.



+3


source


Yes, it's IEEE 754. Basically, the representation is in memory - at least in the Microsoft CLR - and BitConverter.GetBytes(float/double)

just copies the memory directly into the byte array.



+1


source







All Articles