Polaris uses tolerant equality to avoid calculation problems caused by floating-point rounding errors in your models. Instead of requiring two values to be exactly equal, Polaris treats them as equal if their difference is within a small, predefined rounding tolerance. This helps ensure that your calculations consistently return the expected results.
Floating-point errors
Computers store numbers in binary format using the IEEE 754 floating-point standard. Many decimal numbers can't be represented exactly in binary, so the system must approximate them. This approximation introduces tiny, invisible rounding errors during calculations, specifically during equality checks.
These errors are invisible in displayed cell values, but they can produce unexpected logical results that are difficult to diagnose.
Examples of floating-point errors
These examples show how standard computer arithmetic introduces tiny binary rounding discrepancies:
| Calculation | Expected mathematical result | Actual binary result |
| 0.1 + 0.2 | 0.3 | 0.30000000000000004 |
| 10 ÷ 3 | 3.333... (infinite) | 3.3333333333333335 |
| Net-zero formula | 0 | 0.0000000000000001 |
Floating-point errors in Excel
Floating-point errors aren't unique to Anaplan. For example, in Microsoft Excel, high-precision math can cause simple logical tests to fail:
| Cell | Formula | Result |
| A1 | (Direct entry) | 0.000123456789012345 |
| B1 | (Direct entry) | 1 |
| C1 | =A1 + B1 | 1.000123456789012345 (Rounded) |
| D1 | =(C1 - B1) = A1 | FALSE |
Mathematically, (A1 + B1) - B1 should equal A1. But Excel's binary arithmetic introduces a tiny rounding error in C1, causing the equality check to fail.
Tolerant equality in Polaris
To address these problems, Polaris uses tolerant equality. Tolerant equality treats two numbers as equal if the difference between them falls within a tiny rounding tolerance. Instead of requiring an exact binary match, the system accepts values that are practically identical. This prevents minor rounding errors from breaking logical comparisons, ensuring your models behave exactly as you expect.
Polaris automatically uses tolerant equality when comparing numbers, testing for accuracy up to 15 significant figures. When comparing any number to zero, it treats values between −1 × 10⁻¹⁴ and +1 × 10⁻¹⁴ as equal to zero.
What this means for your models
- x = 0 evaluates to TRUE if x is exactly 0, or falls within the tolerance range.
- Logical tests remain stable and behave as expected, even when small rounding errors accumulate.
- No manual precision management is needed, ensuring reliable model behavior automatically.
Polaris compared to the Classic Engine
Both engines use tolerant equality for general number comparisons, but handle zero-comparisons differently.
| Engine | Comparison to zero |
| Classic | Requires a value to be exactly 0. Values extremely close to zero aren't treated as zero. |
| Polaris | Treats values within the tolerance range (−1 × 10⁻¹⁴ to +1 × 10⁻¹⁴) as zero. |
Comparison examples
These examples show how Polaris and the Classic Engine handle tiny rounding errors differently:
| Scenario | Polaris | Classic |
| x = 0 (where x = 0.0000000000000001) | TRUE (within tolerance) | FALSE (requires exact 0) |
IF Remaining Payments = 0 THEN "Debt Paid" ELSE "Debt Outstanding" (with a tiny rounding error) | "Debt Paid" | "Debt Outstanding" |