> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class DoubleUtility

Namespace: [OpenTD.Utility](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net4-reference/OpenTD.Utility)\
Assembly: OpenTD.dll

Utility methods for working with doubles.

```csharp theme={null}
public static class DoubleUtility
```

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[DoubleUtility](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net4-reference/OpenTD.Utility.DoubleUtility.md)

## Inherited Members

[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring),
[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)),
[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)),
[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)

## Properties

### PercentTolerance

Defaults to 0.1%

```csharp theme={null}
public static double PercentTolerance { get; set; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

## Methods

### AreEqual(double, double)

Determines whether two doubles are equal to within the static
DoubleUtility.PercentTolerance.

```csharp theme={null}
public static bool AreEqual(double x1, double x2)
```

#### Parameters

`x1` [double](https://learn.microsoft.com/dotnet/api/system.double)

`x2` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### See Also

[DoubleUtility](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net4-reference/OpenTD.Utility.DoubleUtility.md).[PercentTolerance](#percenttolerance)

### PercentDifference(double, double)

Determines the percent difference between two doubles. Handles
NaN.

```csharp theme={null}
public static double PercentDifference(double x, double y)
```

#### Parameters

`x` [double](https://learn.microsoft.com/dotnet/api/system.double)

`y` [double](https://learn.microsoft.com/dotnet/api/system.double)

#### Returns

[double](https://learn.microsoft.com/dotnet/api/system.double)
