-
-
Couldn't load subscription status.
- Fork 680
Open
Description
The Python builtins max and min are not user-friendly because they give totally wrong results on symbolic input:
sage: max(1/(1-x), 1/x)
-1/(x - 1)
There exist functions max_symbolic and min_symbolic but people generally don't know those functions. They expect max and min to "just work".
One way this puzzles users is when plotting eg the following:
sage: plot(max(1/(1-x), 1/x), (x, 0, 1), ymin=0, ymax=10))
... for which a workaround is to plot using a lambda function:
sage: plot(lambda x: max(1/(1-x), 1/x), (0, 1), ymin=0, ymax=10)
Depends on #24838
Component: symbolics
Keywords: min, max, days79
Issue created by migration from https://trac.sagemath.org/ticket/21945