Skip to content

IsAlmost

Name Mandatory Description Default Type
⬅️ Input The input can be of any number type or a sequence of such types. FloatFloat2Float3Float4IntInt2Int3Int4Int8Int16[Any]
Output ➡️ true if the input is almost equal to the given value; otherwise, false. Bool
Value No The value to test against for almost equality. none FloatFloat2Float3Float4IntInt2Int3Int4Int8Int16[Any]
Threshold No The smallest difference to be considered equal. Should be greater than zero. 1.19209e-07 FloatInt

Checks whether the input is almost equal to a given value.

Examples

1
2
3
4
5
6
7
8
9
; ; integer comparison
199 | Math.Add(300) | IsAlmost(500 Threshold: 1)
Log("Input is almost 500")
Assert.Is(true Break: true)

; ; float comparison
3.95 | IsAlmost(4.0 Threshold: 0.1)
Log("Input is almost 4.0")
Assert.Is(true Break: true)