]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
Add doctests for set_simplification_domain().
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 4 Mar 2013 23:58:59 +0000 (18:58 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 4 Mar 2013 23:58:59 +0000 (18:58 -0500)
mjo/symbolic.py

index e4c6d23faef7117bcd7807da3d95d84a39fd18ad..d2a13298bb74dfbcc18a15434b6427d9aaf911cf 100644 (file)
@@ -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