isprime: raise exception if not integer