# Ticket #8237: trac_8237-maxima_infinity.take2.patch

File trac_8237-maxima_infinity.take2.patch, 3.2 KB (added by burcin, 12 years ago)

apply only this patch

• ## sage/calculus/calculus.py

```# HG changeset patch
# User Burcin Erocal <burcin@erocal.org>
# Date 1266675559 -3600
# Node ID 8a4c49d44fa35e2cfa1ecaf6d02d821451205115
# Parent  493c4a6065bf92d13501a36a9bd9affc705d2cdb
trac 8237: fix conversion of different infinities back from maxima

diff --git a/sage/calculus/calculus.py b/sage/calculus/calculus.py```
 a -x/sqrt(-x^2 + 1) sage: limit(g, x=1, dir='below') -Infinity TESTS:: sage: limit(1/x,x=0) Infinity sage: limit(1/x,x=0,dir='above') +Infinity sage: limit(1/x,x=0,dir='below') -Infinity """ if not isinstance(ex, Expression): ex = SR(ex) symtable = {'%pi':'pi', '%e': 'e', '%i':'I', '%gamma':'euler_gamma', 'li[2]':'polylog2', 'li[3]':'polylog3'} from sage.symbolic.pynac import register_symbol from sage.rings.infinity import infinity, minus_infinity register_symbol(infinity, dict(maxima='inf')) register_symbol(minus_infinity, dict(maxima='minf')) from sage.misc.multireplace import multiple_replace import re sage: a.sage() x != 0 """ global _syms _syms = sage.symbolic.pynac.symbol_table.get('maxima', {}) syms = dict(_syms) if len(x) == 0:
• ## sage/calculus/functional.py

`diff --git a/sage/calculus/functional.py b/sage/calculus/functional.py`
 a sage: lim(exp(x), x=-oo) 0 sage: lim(1/x, x=0) +Infinity Infinity sage: limit(sqrt(x^2+x+1)+x, taylor=True, x=-oo) -1/2 sage: limit((tan(sin(x)) - sin(tan(x)))/x^7, taylor=True, x=0)
• ## sage/symbolic/constants.py

`diff --git a/sage/symbolic/constants.py b/sage/symbolic/constants.py`
 a 13.271347940197249310098819199575813940871106820003074817832971189555 sage: RDF(a) 13.2713479402 Test if #8237 is fixed:: sage: maxima('infinity').sage() Infinity sage: maxima('inf').sage() +Infinity sage: maxima('minf').sage() -Infinity """ ############################################################################### #   Sage: Open Source Mathematical Software #       Copyright (C) 2008 William Stein #       Copyright (C) 2008 Burcin Erocal #       Copyright (C) 2008-2010 Burcin Erocal #                     2009 Mike Hansen #  Distributed under the terms of the GNU General Public License (GPL), #  version 2 or any later version.  The full text of the GPL is available at: constants_name_table[repr(unsigned_infinity)] = unsigned_infinity constants_name_table[repr(minus_infinity)] = minus_infinity import sage.symbolic.pynac sage.symbolic.pynac.register_symbol(infinity, {'maxima':'inf'}) sage.symbolic.pynac.register_symbol(minus_infinity, {'maxima':'minf'}) sage.symbolic.pynac.register_symbol(unsigned_infinity, {'maxima':'infinity'}) def unpickle_Constant(class_name, name, conversions, latex, mathml, domain): """ EXAMPLES::