We return the base types and not the provided types because we don't want to create invalid terms. Providing negative number to a function unary - for example should not return a term of type negative number having a positive value.
the numeric operator performed
whether to add invalid handling, whether to add
Optional
addInvalidHandling: booleanOptional
addInvalidHandling: booleanOptional
addInvalidHandling: booleanOptional
addInvalidHandling: booleanOptional
addInvalidHandling: booleanOptional
addInvalidHandling: boolean
!!! Be aware when using this function, it will create different overloads with different return types !!! Arithmetic operators take 2 numeric arguments, and return a single numerical value. The type of the return value is heavily dependent on the types of the input arguments. In JS everything is a double, but in SPARQL it is not.
The different arguments are handled by type promotion and subtype substitution. The way numeric function arguments work is described here: https://www.w3.org/TR/xpath20/#mapping Above url is referenced in the sparql spec: https://www.w3.org/TR/sparql11-query/#OperatorMapping