Click or drag to resize

NMathFunctionsIf(Int32, FuncDouble, Boolean, Double, Double) Method

Creates a new array by applying a logical function to the elements of an array. Elements in the original array that return true are set to the given true value in the new array; elements that return false are set to the given false value.

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
public static double[] If(
	int[] data,
	Func<double, bool> function,
	double ifTrue,
	double ifFalse
)

Parameters

data  Int32
An array of integers.
function  FuncDouble, Boolean
A function that takes a double and returns a boolean.
ifTrue  Double
Value in case of true.
ifFalse  Double
Value in case of false.

Return Value

Double
A new array.
Remarks
Integer values will be promoted to floating-point values for the calculation. The array will not be altered.
See Also