Click or drag to resize

FloatingPointComparisonDivideRoundTripIsGreaterOrEqual Method

Divides a dividend by a divisor such that if the quotient is later multiplied by the divisor the result is greater than or equal to the dividend.

Namespace:  AGI.Foundation
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.3.420.0 (24.3.420.0)
Syntax
public static double DivideRoundTripIsGreaterOrEqual(
	double dividend,
	double divisor
)

Parameters

dividend
Type: SystemDouble
The dividend.
divisor
Type: SystemDouble
The divisor.

Return Value

Type: Double
The quotient.
Remarks
If floating point numbers were infinitely precise, this method would be unnecessary. Since they're not, this method allows you to have control over how the error falls. For example, imagine that you have a floating point number that represents the minimum value allowed as input to a function. You want to express that minimum value in a different set of units such that the user can pass the minimum value to the function in that different set of units. By using this method to do the conversion to the alternate set of units, you guarantee that upon converting that value back to the original set of units the value will be greater than or equal to the original minimum value. Using a normal division might cause the value to actually be less than the minimum upon doing the round-trip conversion, which would likely cause the function to fail.
See Also