Link Search Menu Expand Document

πŸ– Modulo Comparison

PCGEx | Filter : Modulo Compare

Compares the modulo of two attributes against a third operand, with configurable comparisons and tolerance.

-


Filter
A single filter definition

Table of content


The Modulo Filter compares the modulo of two values against a third.

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

Properties


Property Description
Operand A
Operand A The first attribute of the comparison.
Operand B
Operand B Source Type of operand B. Can be a per-point Attribute, or an easily overridable Constant.
Compare B
(Constant or Attribute)
Operand B used for modulo.
Comparison
Comparison How to compare the two A % B against C.
See Numeric comparisons.
Operand C
Compare Against Type of operand C. Can be a per-point Attribute, or an easily overridable Constant.
Operand C Attribute that contains the per-point operand B value.
Operand C
(Constant or Attribute)
Operand C. This value will be tested against the modulo’ result.
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!