<PackageReference Include="NUnit" Version="3.9.0" />

FloatingPointNumerics

public class FloatingPointNumerics
Helper routines for working with floating point numbers
public static bool AreAlmostEqualUlps(float left, float right, int maxUlps)

Compares two floating point values for equality

public static bool AreAlmostEqualUlps(double left, double right, long maxUlps)

Compares two double precision floating point values for equality

public static double ReinterpretAsDouble(long value)

Reinterprets the memory contents of an integer value as a double precision floating point value

public static float ReinterpretAsFloat(int value)

Reinterprets the memory contents of an integer as a floating point value

public static int ReinterpretAsInt(float value)

Reinterprets the memory contents of a floating point value as an integer value

public static long ReinterpretAsLong(double value)

Reinterprets the memory contents of a double precision floating point value as an integer value