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: (
public static bool IsApproximately(
	this float float1,
	float float2,
	float maxAllowedDifference


Type: SystemSingle
The first float to check
Type: SystemSingle
The second float to check
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