Avoid unnecessary math computation

Various built-in SPARQL function libraries provide access to a range of
math computations.  However some of these can result in generating very
large outputs that won't fit into the target type.  This commit adds a
new MathLimits static helper with pre-computation validation functions
that are called to check whether a given computation should be computed
and throw an error if its output would be excessive.
19 files changed