Changeset 7634:fb4045978e5b
- Timestamp:
- 12/13/07 10:38:31 (5 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
sage/calculus/calculus.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sage/calculus/calculus.py
r7618 r7634 196 196 5 197 197 198 Simplifying expressions involving scientific notation: 199 sage: k = var('k') 200 sage: a0 = 2e-6; a1 = 12 201 sage: c = a1 + a0*k; c 202 2.000000000000000e-6*k + 12 203 sage: sqrt(c) 204 sqrt(2.000000000000000e-6*k + 12) 205 sage: sqrt(c^3) 206 (2.000000000000000e-6*k + 12)^(3/2) 207 198 208 The symbolic Calculus package uses its own copy of Maxima for 199 209 simplification, etc., which is separate from the default system-wide … … 235 245 PolynomialRing, ComplexField, 236 246 algdep, Integer, RealNumber) 247 248 from sage.rings.real_mpfr import create_RealNumber 237 249 238 250 from sage.structure.element import RingElement, is_Element … … 5982 5994 s = s.replace('=','==') 5983 5995 5984 #replace all instances of scientific notation5996 #replace all instances of Maxima's scientific notation 5985 5997 #with regular notation 5986 5998 search = sci_not.search(s) 5987 5999 while not search is None: 5988 6000 (start, end) = search.span() 5989 s = s.replace(s[start:end], str(RR(s[start:end]))) 6001 r = create_RealNumber(s[start:end]).str(no_sci=2, truncate=True) 6002 s = s.replace(s[start:end], r) 5990 6003 search = sci_not.search(s) 5991 6004
Note: See TracChangeset
for help on using the changeset viewer.
