Link Search Menu Expand Document

πŸ– Compare (Numeric)

PCGEx | Filter : Compare (Numeric)

The **Numeric Comparison Filter compares the arithmetic value of two attributes**

-


Filter
A single filter definition

Table of content


The Compare (Numeric) compares two attributes against each other.

Note that each value is converted to a double under the hood, so you can’t compare multi-component value with it.

details/filter-ecosystem/filter-compare-numeric-lead.png

Properties


Property Description
Operand A
Operand A The first attribute of the comparison.
Comparison
Comparison How to compare A against B.
See Numeric comparisons.
Operand B
Compare Against Type of operand B. Can be a per-point Attribute, or an easily overridable Constant.
Operand B
(Constant or Attribute)
Operand B, or second value to compare to the first.
Tolerance Equality tolerance for near-value comparisons.

Comparison modes


Comparison Data
== Strictly equal.
!= Strictly not equal.
>= Equal or greater.
<= Equal or smaller.
> Strictly greater.
< Strictly smaller.
~= Nearly equal.
!~= Nearly not equal.

Approximative comparison will reveal an additional parameter, dubbed Tolerance. This represents the size of acceptable approximation for the comparison to pass. For example, when checking if 0.5 ~= 0.4 with a tolerance of 0.1 will return true.

Large tolerances can be a great, cheap way to achieve results akin to a β€œwithin range” comparison!