Use sympify instead of Basic.sympify (#667)
[sympy.git] / sympy / functions / elementary / miscellaneous.py
blob6834216a214d81767569604677f3ced2ac780b7b
2 from sympy.core.basic import Basic, S, C, sympify
3 from sympy.core.function import Lambda, Function
5 ###############################################################################
6 ############################# SQUARE ROOT FUNCTION ############################
7 ###############################################################################
9 def sqrt(arg):
10 arg = sympify(arg)
11 return arg**S.Half
13 ###############################################################################
14 ############################# MINIMUM and MAXIMUM #############################
15 ###############################################################################
17 class max_(Function):
19 nargs = 2
21 def canonize(cls, x, y):
22 if isinstance(x, C.Number) and isinstance(y, C.Number):
23 return max(x, y)
24 if x.is_positive:
25 if y.is_negative:
26 return x
27 if y.is_positive:
28 if x.is_unbounded:
29 if y.is_unbounded:
30 return
31 return x
32 elif x.is_negative:
33 if y.is_negative:
34 if y.is_unbounded:
35 if x.is_unbounded:
36 return
37 return x
39 class min_(Function):
41 nargs = 2
43 def canonize(cls, x, y):
44 if isinstance(x, C.Number) and isinstance(y, C.Number):
45 return min(x, y)