Namespace: PdfSharp.Internal
Some floating-point utilities. Partially taken from WPF.
public static class DoubleUtil
Inheritance Object → DoubleUtil
Indicates whether the values are so close that they can be considered as equal.
public static bool AreClose(double value1, double value2)
value1
Double
value2
Double
Indicates whether the values are so close that they can be considered as equal.
public static bool AreRoughlyEqual(double value1, double value2, int decimalPlace)
value1
Double
value2
Double
decimalPlace
Int32
Indicates whether the values are so close that they can be considered as equal.
public static bool AreClose(XPoint point1, XPoint point2)
point1
XPoint
point2
XPoint
Indicates whether the values are so close that they can be considered as equal.
public static bool AreClose(XRect rect1, XRect rect2)
rect1
XRect
rect2
XRect
Indicates whether the values are so close that they can be considered as equal.
public static bool AreClose(XSize size1, XSize size2)
size1
XSize
size2
XSize
Indicates whether the values are so close that they can be considered as equal.
public static bool AreClose(XVector vector1, XVector vector2)
vector1
XVector
vector2
XVector
Indicates whether value1 is greater than value2 and the values are not close to each other.
public static bool GreaterThan(double value1, double value2)
value1
Double
value2
Double
Indicates whether value1 is greater than value2 or the values are close to each other.
public static bool GreaterThanOrClose(double value1, double value2)
value1
Double
value2
Double
Indicates whether value1 is less than value2 and the values are not close to each other.
public static bool LessThan(double value1, double value2)
value1
Double
value2
Double
Indicates whether value1 is less than value2 or the values are close to each other.
public static bool LessThanOrClose(double value1, double value2)
value1
Double
value2
Double
Indicates whether the value is between 0 and 1 or close to 0 or 1.
public static bool IsBetweenZeroAndOne(double value)
value
Double
Indicates whether the value is not a number.
public static bool IsNaN(double value)
value
Double
Indicates whether at least one of the four rectangle values is not a number.
public static bool RectHasNaN(XRect r)
r
XRect
Indicates whether the value is 1 or close to 1.
public static bool IsOne(double value)
value
Double
Indicates whether the value is 0 or close to 0.
public static bool IsZero(double value)
value
Double
Converts a double to integer.
public static int DoubleToInt(double value)
value
Double