From 265daef10f8bc8d84263f94b8401e22bdb8adf8d Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 4 Mar 2013 18:58:59 -0500 Subject: [PATCH] Add doctests for set_simplification_domain(). --- mjo/symbolic.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mjo/symbolic.py b/mjo/symbolic.py index e4c6d23..d2a1329 100644 --- a/mjo/symbolic.py +++ b/mjo/symbolic.py @@ -9,7 +9,23 @@ def set_simplification_domain(d): INPUT: - - d -- The domain, either 'real' or 'complex'. + - ``d`` -- The domain, either 'real' or 'complex'. + + TESTS: + + With the default 'complex' domain, we don't simplify this:: + + sage: (abs(x)^2).simplify() + abs(x)^2 + + But in the 'real' domain, we do:: + + sage: set_simplification_domain('real') + 'real' + sage: (abs(x)^2).simplify() + x^2 + sage: set_simplification_domain('complex') + 'complex' """ cmd = 'domain: %s;' % d -- 2.44.2