optionally use imath for arbitrary precision integers