PDFsharp-net6

DoubleUtil

Namespace: PdfSharp.Internal

Some floating-point utilities. Partially taken from WPF.

public static class DoubleUtil

Inheritance ObjectDoubleUtil

Methods

AreClose(Double, Double)

Indicates whether the values are so close that they can be considered as equal.

public static bool AreClose(double value1, double value2)

Parameters

value1 Double

value2 Double

Returns

Boolean

AreRoughlyEqual(Double, Double, Int32)

Indicates whether the values are so close that they can be considered as equal.

public static bool AreRoughlyEqual(double value1, double value2, int decimalPlace)

Parameters

value1 Double

value2 Double

decimalPlace Int32

Returns

Boolean

AreClose(XPoint, XPoint)

Indicates whether the values are so close that they can be considered as equal.

public static bool AreClose(XPoint point1, XPoint point2)

Parameters

point1 XPoint

point2 XPoint

Returns

Boolean

AreClose(XRect, XRect)

Indicates whether the values are so close that they can be considered as equal.

public static bool AreClose(XRect rect1, XRect rect2)

Parameters

rect1 XRect

rect2 XRect

Returns

Boolean

AreClose(XSize, XSize)

Indicates whether the values are so close that they can be considered as equal.

public static bool AreClose(XSize size1, XSize size2)

Parameters

size1 XSize

size2 XSize

Returns

Boolean

AreClose(XVector, XVector)

Indicates whether the values are so close that they can be considered as equal.

public static bool AreClose(XVector vector1, XVector vector2)

Parameters

vector1 XVector

vector2 XVector

Returns

Boolean

GreaterThan(Double, Double)

Indicates whether value1 is greater than value2 and the values are not close to each other.

public static bool GreaterThan(double value1, double value2)

Parameters

value1 Double

value2 Double

Returns

Boolean

GreaterThanOrClose(Double, Double)

Indicates whether value1 is greater than value2 or the values are close to each other.

public static bool GreaterThanOrClose(double value1, double value2)

Parameters

value1 Double

value2 Double

Returns

Boolean

LessThan(Double, 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)

Parameters

value1 Double

value2 Double

Returns

Boolean

LessThanOrClose(Double, Double)

Indicates whether value1 is less than value2 or the values are close to each other.

public static bool LessThanOrClose(double value1, double value2)

Parameters

value1 Double

value2 Double

Returns

Boolean

IsBetweenZeroAndOne(Double)

Indicates whether the value is between 0 and 1 or close to 0 or 1.

public static bool IsBetweenZeroAndOne(double value)

Parameters

value Double

Returns

Boolean

IsNaN(Double)

Indicates whether the value is not a number.

public static bool IsNaN(double value)

Parameters

value Double

Returns

Boolean

RectHasNaN(XRect)

Indicates whether at least one of the four rectangle values is not a number.

public static bool RectHasNaN(XRect r)

Parameters

r XRect

Returns

Boolean

IsOne(Double)

Indicates whether the value is 1 or close to 1.

public static bool IsOne(double value)

Parameters

value Double

Returns

Boolean

IsZero(Double)

Indicates whether the value is 0 or close to 0.

public static bool IsZero(double value)

Parameters

value Double

Returns

Boolean

DoubleToInt(Double)

Converts a double to integer.

public static int DoubleToInt(double value)

Parameters

value Double

Returns

Int32