-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Numericshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors
Description
BitConverter has APIs to convert float -> int, but not uint. Sometimes it's useful to get the uint bits underlying a float too (for ex: I'd find it useful for #936).
API:
public static unsafe ulong DoubleToUInt64Bits(double value);
public static unsafe double UInt64BitsToDouble(ulong value)
public static unsafe ushort HalfToUInt16Bits(Half value);
public static unsafe Half UInt16BitsToHalf(ushort value)
public static unsafe uint SingleToUInt32Bits(float value);
public static unsafe float UInt32BitsToSingle(uint value)Note: uint is not CLS compliant
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Numericshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors