Click or drag to resize

analysisExtensionsGetRatio Method (Double, Double, Double, Double)

imbSCI | imbACE | imbNLP | imbWEM | imbWBI
Zero-input safe ratio calculation: part / whole

Namespace:  imbSCI.Core.math
Assembly:  imbSCI.Core (in imbSCI.Core.dll) Version: 0.3.58.
Syntax
C#
public static double GetRatio(
	this double part,
	double whole,
	double ifPartIsZero = 0,
	double ifWholeIsZeroAndPartNot = 1
)
Request Example View Source

Parameters

part
Type: SystemDouble
The part - upper part of fraction equasion
whole
Type: SystemDouble
The whole - lower part of fraction equasion
ifPartIsZero (Optional)
Type: SystemDouble
Value for case when part is 0
ifWholeIsZeroAndPartNot (Optional)
Type: SystemDouble
Value for case when whole is 0 but part is not zero

Return Value

Type: Double
Ratio from 0 to 1

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Double. 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