# HG changeset patch
# User Stefan Reiterer <domors@gmx.net>
# Date 1386542385 3600
# Node ID 65b2ade30163c20c0b409c7852de975af56dc8fe
# Parent 738e19cfa1802702b6f6e8c501efacd9022eb631
trac 9706: fixed U_{1} bug + docstring
diff git a/sage/functions/orthogonal_polys.py b/sage/functions/orthogonal_polys.py
a

b


677  677  ValueError: No compatible type! 
678  678  
679  679  """ 
680   if args[0] in ZZ: 
 680  if args[0] in ZZ and args[0] >= 0: 
681  681  return self._cheb_recur_(*args)[0] 
682  682  
683  683  try: 
… 
… 

964  964  ... 
965  965  ValueError: No compatible type! 
966  966  """ 
967   if args[0] in ZZ: 
 967  if args[0] in ZZ and args[0] >= 0: 
968  968  return self._cheb_recur_(*args)[0] 
969  969  try: 
970  970  real_parent = kwds['parent'] 
… 
… 

1022  1022  Traceback (most recent call last): 
1023  1023  ... 
1024  1024  ValueError: No special values for non integral indices! 
 1025  sage: chebyshev_U(1,Mod(5,8)) 
 1026  0 
 1027  sage: parent(chebyshev_U(1,Mod(5,8))) 
 1028  Ring of integers modulo 8 
1025  1029  """ 
1026  1030  if (not is_Expression(args[0])) and (not args[0] in ZZ): 
1027  1031  raise ValueError("No special values for non integral indices!") 
1028   
 1032  
 1033  if args[0] == 1: 
 1034  return args[1]*0 
 1035  
1029  1036  if args[1] == 1: 
1030  1037  return args[1]*(args[0]+1) 
1031  1038  