ActivePivot

ActivePivot

  • User Guide
  • Developer Documentation
  • Help
  • Versions

›CoPPer

CoPPer

  • Introduction
  • The API
  • Flat and Multi-Dimensional Representations
  • Examples
  • Presentation Meta Data
  • Arithmetic Operations and Edge Cases
  • Advanced Topics

Arithmetic Operations and Edge Cases

The advantage of the arithmetical operators like .plus(), .minus(), .multiply() etc... is that they handle for you the different types that can be in the data in an efficient way, and they help CoPPer understand your business logic so that it can optimize it.

Their behavior is straight-forward based on their name, but we have to explain what happens in the edge cases: when an operand is null or equal to zero for instance:

Operationa is nullb is nullb is zero
a.plus(b)returns nullreturns nullreturns a
a.minus(b)returns nullreturns nullreturns a
a.multiply(b)returns nullreturns nullreturns 0
a.divide(b)returns nullreturns nullThrows an ArithmeticException at query time

Which can be summarized by: Even in CoPPer, never divide by zero, otherwise if any operand is missing we return null.

← Presentation Meta DataAdvanced Topics →
ActivePivot
Docs
Getting StartedAPI Reference
Community
Stack OverflowLinkedinTwitter
More
Blog
Copyright © 2020 ActiveViam