Similar to the comments highlighted in dotnet/coreclr#833, the BitConverter.DoubleToInt32Bits and Int32BitsToDouble methods contain endianness comments which are almost certainly irrelevant.
- The .NET Framework doesn't support, and is unlikely to ever support, any architecture which uses a different endianness for its internal representation of integers and floating-point numbers.
- The current implementation of this method does already work on both little- and big-endian machines, provided the
Contract.Assert call is not there.
I recommend these comments as well as the calls to Contract.Assert be removed, and the documentation updated to explicitly include the following text (or an equivalent variant) stating a precondition that has always existed but was previously undocumented.
This method assumes the hardward uses the same endianness for integers and floating-point numbers.
Similar to the comments highlighted in dotnet/coreclr#833, the
BitConverter.DoubleToInt32BitsandInt32BitsToDoublemethods contain endianness comments which are almost certainly irrelevant.Contract.Assertcall is not there.I recommend these comments as well as the calls to
Contract.Assertbe removed, and the documentation updated to explicitly include the following text (or an equivalent variant) stating a precondition that has always existed but was previously undocumented.