Link Search Menu Expand Document

πŸ– Self Compare (Numeric)

PCGEx | Filter : Self Compare (Numeric)

Compares the numeric value at one index against the same attribute at another index.

-


Filter
A single filter definition

Table of content


The Self Compare (Numeric) compares the point’ value of a single attribute against that same attribute at another index.

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-self-lead.png

Properties


Property Description
Operand A
Operand A The attribute to read compared values from.
Comparison
Comparison How to compare A against B.
See Numeric comparisons.
Tolerance Equality tolerance for near-value comparisons.
Index
Index Mode Choose how to process the Index value as either a Pick (specific index), or an Offset applied to the currently tested point’ index.
Compare Against Type of values for the Index. Can be a per-point Attribute, or an easily overridable Constant.
Index
(Constant or Attribute)
Value to use as Index/Offset.

details/filter-ecosystem/filter-compare-self-explainer.png

Index Safety

The index safety property controls how invalid/out of bounds input values are handled.

Safety method Β 
Ignore Invalid indices will be ignored and won’t be processed further.
Tile Index is tiled (wrapped around) the context’ valid min/max range.
Clamp Index is clamped between the context’ valid min/max range.
Yoyo Index bounces back and forth between the context’ valid min/max range.

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!