Click or drag to resize

ExtensionMethodsIsApproximately Method

Check to see if a float is close to another.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static bool IsApproximately(
	this float float1,
	float float2,
	float maxAllowedDifference
)

Parameters

float1
Type: SystemSingle
The first float to check
float2
Type: SystemSingle
The second float to check
maxAllowedDifference
Type: SystemSingle
The maximum delta that can be between these two values (inclusive)

Return Value

Type: Boolean
True if it's within the acceptable range, false otherwise.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Single. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also