@public
def trunc(f, p, *gens, **args):
 options.allowed_flags(args, ['auto', 'polys'])
 try:
  (F, opt) = poly_from_expr(f, *gens, **args)
 except PolificationFailed as exc:
  raise ComputationFailed('trunc', 1, exc)
 result = F.trunc(sympify(p))
 if (not opt.polys):
  return result.as_expr()
 else:
  return result

@ public def trunc ( f , p , * gens , ** args ) : options . allowed_flags ( args , [ 'auto' , 'polys' ] ) try : ( F , opt ) = poly_from_expr ( f , * gens , ** args ) except PolificationFailed as exc : raise ComputationFailed ( 'trunc' , 1 , exc ) result = F . trunc ( sympify ( p ) ) if ( not opt . polys ) : return result . as_expr ( ) else : return result
reduce f modulo a constant p .