class_docstr: Returns the remainder when ``p`` is divided by ``q`` where ``p`` is finite
  and ``q`` is not equal to zero. The result, ``p - int(p/q)*q``, has the same sign
  as the divisor.
  
  Parameters
  ==========
  
  p : Expr
      Dividend.
  
  q : Expr
      Divisor.
  
  Notes
  =====
  
  ``Rem`` corresponds to the ``%`` operator in C.
  
  Examples
  ========
  
  >>> from sympy.abc import x, y
  >>> from sympy import Rem
  >>> Rem(x**3, y)
  Rem(x**3, y)
  >>> Rem(x**3, y).subs({x: -5, y: 3})
  -2
  
  See Also
  ========
  
  Mod
class_docstr_tok: ["Returns","the","remainder","when","``","p","``","is","divided","by","``","q","``","where","``","p","``","is","finite","and","``","q","``","is","not","equal","to","zero",".","The","result",",","``","p","-","int","(","p\/q",")","*","q","``",",","has","the","same","sign","as","the","divisor",".","Parameters","==========","p",":","Expr","Dividend",".","q",":","Expr","Divisor",".","Notes","=====","``","Rem","``","corresponds","to","the","``","%","``","operator","in","C.","Examples","========",">",">",">","from","sympy.abc","import","x",",","y",">",">",">","from","sympy","import","Rem",">",">",">","Rem","(","x","*","*","3",",","y",")","Rem","(","x","*","*","3",",","y",")",">",">",">","Rem","(","x","*","*","3",",","y",")",".subs","(","{","x",":","-5",",","y",":","3","}",")","-2","See","Also","========","Mod"]
docstr: Return the function remainder if both p, q are numbers and q is not
  zero.
code: def eval(cls, p, q):
      """Return the function remainder if both p, q are numbers and q is not
      zero.
      """
  
      if q.is_zero:
          raise ZeroDivisionError("Division by zero")
      if (
          p is S.NaN
          or q is S.NaN
          or p.is_finite is False
          or q.is_finite is False
      ):
          return S.NaN
      if p is S.Zero or p in (q, -q) or (p.is_integer and q == 1):
          return S.Zero
  
      if q.is_Number:
          if p.is_Number:
              return p - Integer(p / q) * q
  
imports: from sympy.core import Function, S, sympify, NumberKind
  from sympy.utilities.iterables import sift
  from sympy.core.add import Add
  from sympy.core.containers import Tuple
  from sympy.core.operations import LatticeOp, ShortCircuit
  from sympy.core.function import Application, Lambda, ArgumentIndexError
  from sympy.core.expr import Expr
  from sympy.core.exprtools import factor_terms
  from sympy.core.mod import Mod
  from sympy.core.mul import Mul
  from sympy.core.numbers import Rational
  from sympy.core.power import Pow
  from sympy.core.relational import Eq, Relational
  from sympy.core.singleton import Singleton
  from sympy.core.sorting import ordered
  from sympy.core.symbol import Dummy
  from sympy.core.rules import Transform
  from sympy.core.logic import fuzzy_and, fuzzy_or, _torf
  from sympy.core.traversal import walk
  from sympy.core.numbers import Integer
  from sympy.logic.boolalg import And, Or
label_desc: Use image node_id 1 for calling the Rem obj's underlying member method code with example usage: obj.eval(cls, p, q) and returns: S, S, unknown