largestFloat() Function
Returns the largest floating-point value in range [min
, max
] that is accepted by the predicate
.
Signature
export declare function largestFloat(min: number, max: number, predicate: (value: number) => boolean, maxIterations?: number): number | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
min | number | The minimum value to search for. |
max | number | The maximum value to search for. |
predicate | (value: number) => boolean | A predicate. There should exist some value |
maxIterations | number | Maximum number of iterations to perform. It can be reduced to speed up the search for less precise values. |
(Returns) | number | undefined | The largest floating-point value whose predicate returns |