Method | Description | |
---|---|---|
AreAlmostEqualUlps ( double left, double right, long maxUlps ) : bool |
Compares two double precision floating point values for equality Double precision floating point values can only represent a limited series of natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004 can be stored in a double, but nothing inbetween them. This comparison will count how many possible double precision floating point values are between the left and the right number. If the number of possible values between both numbers is less than or equal to maxUlps, then the numbers are considered as being equal. Implementation partially follows the code outlined here: http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ |
|
AreAlmostEqualUlps ( float left, float right, int maxUlps ) : bool |
Compares two floating point values for equality Floating point values can only represent a finite subset of natural numbers. For example, the values 2.00000000 and 2.00000024 can be stored in a float, but nothing inbetween them. This comparison will count how many possible floating point values are between the left and the right number. If the number of possible values between both numbers is less than or equal to maxUlps, then the numbers are considered as being equal. Implementation partially follows the code outlined here: http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ |
|
ReinterpretAsDouble ( long value ) : double |
Reinterprets the memory contents of an integer value as a double precision floating point value
|
|
ReinterpretAsFloat ( int value ) : float |
Reinterprets the memory contents of an integer as a floating point value
|
|
ReinterpretAsInt ( float value ) : int |
Reinterprets the memory contents of a floating point value as an integer value
|
|
ReinterpretAsLong ( double value ) : long |
Reinterprets the memory contents of a double precision floating point value as an integer value
|
Method | Description | |
---|---|---|
FloatingPointNumerics ( ) : System |
public static AreAlmostEqualUlps ( double left, double right, long maxUlps ) : bool | ||
left | double | First double precision floating point value to be compared |
right | double | Second double precision floating point value t be compared |
maxUlps | long | /// Maximum number of representable double precision floating point values that are /// allowed to be between the left and the right double precision floating point values /// |
return | bool |
public static AreAlmostEqualUlps ( float left, float right, int maxUlps ) : bool | ||
left | float | First floating point value to be compared |
right | float | Second floating point value t be compared |
maxUlps | int | /// Maximum number of representable floating point values that are allowed to /// be between the left and the right floating point values /// |
return | bool |
public static ReinterpretAsDouble ( long value ) : double | ||
value | long | Integer whose memory contents to reinterpret |
return | double |
public static ReinterpretAsFloat ( int value ) : float | ||
value | int | Integer value whose memory contents to reinterpret |
return | float |
public static ReinterpretAsInt ( float value ) : int | ||
value | float | /// Floating point value whose memory contents to reinterpret /// |
return | int |
public static ReinterpretAsLong ( double value ) : long | ||
value | double | /// Double precision floating point value whose memory contents to reinterpret /// |
return | long |