Ticket #13857: minmax.patch

File minmax.patch, 2.3 KB (added by Madrosity, 9 years ago)
  • doc/en/reference/functions/index.rst

    # HG changeset patch
    # User Nathaniel Skinner <zskinner@gmail.com>
    # Date 1373466225 14400
    # Node ID a6342c7a6ae285fbe715fa03c7c4edef200ac120
    # Parent  1077314f416653b28e199c382667a1f11e444bdd
    Trac 13857: symbolic minmax commentary
    
    diff --git a/doc/en/reference/functions/index.rst b/doc/en/reference/functions/index.rst
    a b  
    1515   sage/functions/wigner
    1616   sage/functions/generalized
    1717   sage/functions/prime_pi
     18   sage/functions/min_max
    1819
    1920.. include:: ../footer.txt
  • sage/functions/min_max.py

    diff --git a/sage/functions/min_max.py b/sage/functions/min_max.py
    a b (this hunk was shorter than expected) 
     1r"""
     2Symbolic Minimum and Maximum
     3
     4This function was introduced due to the fact that max and min were not
     5able to deal with variables as expected. This function strives to be a better evaluator of
     6expressions by waiting to evaluate if there are variables.
     7
     8Here you can see some Differences::
     9
     10   sage: max(x,x^2)
     11   x
     12   sage: max_symbolic(x,x^2)
     13   max(x, x^2)
     14   sage: max(3,5,x)
     15   5
     16   sage: min(3,5,x)
     17   3
     18   sage: max_symbolic(3,5,x)
     19   max(x, 5)
     20   sage: min_symbolic(3,5,x)
     21   min(x, 3)
     22
     23"""
    124###############################################################################
    225#   Sage: Open Source Mathematical Software
    326#       Copyright (C) 2010 Burcin Erocal <burcin@erocal.org>
     
    138163class MaxSymbolic(MinMax_base):
    139164    def __init__(self):
    140165        r"""
    141         Symbolic `max` function.
     166        Symbolic `\max` function.
    142167
    143         The Python builtin `max` function doesn't work as expected when symbolic
     168        The Python builtin `\max` function doesn't work as expected when symbolic
    144169        expressions are given as arguments. This function delays evaluation
    145170        until all symbolic arguments are substituted with values.
    146171
     
    224249class MinSymbolic(MinMax_base):
    225250    def __init__(self):
    226251        r"""
    227         Symbolic `min` function.
     252        Symbolic `\min` function.
    228253
    229         The Python builtin `min` function doesn't work as expected when symbolic
     254        The Python builtin `\min` function doesn't work as expected when symbolic
    230255        expressions are given as arguments. This function delays evaluation
    231256        until all symbolic arguments are substituted with values.
    232257