fixed the implementation of the inv q functions and added the intCast to avoid implicit int conversions, related to ticket #759.
Authored by: raph-z 2023-02-13
Parent: [r1327]
Child: [r1329]