Adds support (freezing, typing, printing) for the following integer functions from sympyextensions.integer_functions
:
The following are left for future work because they can be conveniently implemented with an if
expression (the ternary if operator ?:
in C) which is currently not available.
div_floor
is also not implemented because to me the semantics of this function are unclear.
Is it supposed to compute
The typifier tries to infer the integer type of the arguments/result and always raises if the type is non-integer.
Note that this can lead to cases in which an exception is raised because the inference fails.
For example int_div(2, 3)
where both arguments are untyped constants.
This could be improved in the typifier, e.g. by adding type constraints to deferred constants (also left for future work).