Add asInteger and asBoundedIntegral functions