Преглед изворни кода

Add remaining backtricks for mathematical notation.

Sander Mathijs van Veen пре 13 година
родитељ
комит
b3f48cb694
4 измењених фајлова са 8 додато и 9 уклоњено
  1. 6 6
      src/rules/logarithmic.py
  2. 1 1
      src/rules/numerics.py
  3. 1 1
      src/rules/powers.py
  4. 0 1
      src/rules/precedences.py

+ 6 - 6
src/rules/logarithmic.py

@@ -58,7 +58,7 @@ def base_equals_raised(root, args):
     return L(1).negate(root.negated)
 
 
-MESSAGES[base_equals_raised] = _('Logarithm {0} reduces to 1.')
+MESSAGES[base_equals_raised] = _('Logarithm {0} reduces to `1`.')
 
 
 def divide_same_base(root, args):
@@ -70,7 +70,7 @@ def divide_same_base(root, args):
     return log(raised) / log(base)
 
 
-MESSAGES[divide_same_base] = _('Apply log_b(a) = log(a) / log(b) on {0}.')
+MESSAGES[divide_same_base] = _('Apply `log_b(a) = log(a) / log(b)` on {0}.')
 
 
 def match_add_logarithms(node):
@@ -127,7 +127,7 @@ def add_logarithms(root, args):
     return scope.as_nary_node()
 
 
-MESSAGES[add_logarithms] = _('Apply log(a) + log(b) = log(ab).')
+MESSAGES[add_logarithms] = _('Apply `log(a) + log(b) = log(ab)`.')
         #_('Combine logarithms with the same base: {2} and {3}.')
 
 
@@ -144,7 +144,7 @@ def expand_negations(root, args):
 
 
 MESSAGES[expand_negations] = \
-        _('Apply -log(a) - log(b) = -(log(a) + log(b)).')
+        _('Apply `-log(a) - log(b) = -(log(a) + log(b))`.')
 
 
 def subtract_logarithms(root, args):
@@ -161,7 +161,7 @@ def subtract_logarithms(root, args):
     return scope.as_nary_node()
 
 
-MESSAGES[subtract_logarithms] = _('Apply log(a) - log(b) = log(a / b).')
+MESSAGES[subtract_logarithms] = _('Apply `log(a) - log(b) = log(a / b)`.')
 
 
 def match_raised_base(node):
@@ -212,7 +212,7 @@ def raised_base(root, args):
     return args[0]
 
 
-MESSAGES[raised_base] = _('Apply g ^ log_g(a) = a on {0}.')
+MESSAGES[raised_base] = _('Apply `g ^ (log_(g)(a)) = a` on {0}.')
 
 
 def match_factor_out_exponent(node):

+ 1 - 1
src/rules/numerics.py

@@ -2,7 +2,7 @@ from itertools import combinations
 
 from .utils import greatest_common_divisor, is_numeric_node
 from ..node import ExpressionLeaf as Leaf, Scope, OP_ADD, OP_DIV, OP_MUL, \
-        OP_POW, negate
+        OP_POW
 from ..possibilities import Possibility as P, MESSAGES
 from ..translate import _
 

+ 1 - 1
src/rules/powers.py

@@ -293,7 +293,7 @@ def remove_power_of_zero(root, args):
     return L(1)
 
 
-MESSAGES[remove_power_of_zero] = _('Power of zero {0} rewrites to 1.')
+MESSAGES[remove_power_of_zero] = _('Power of zero {0} rewrites to `1`.')
 
 
 def remove_power_of_one(root, args):

+ 0 - 1
src/rules/precedences.py

@@ -7,7 +7,6 @@ from .logarithmic import factor_in_exponent_multiplicant, \
 from .derivatives import chain_rule
 from .negation import double_negation, negated_factor, negated_nominator, \
         negated_denominator, negated_zero
-from .factors import expand_double, expand_single
 from .fractions import multiply_with_fraction, divide_fraction_by_term, \
         add_nominators
 from .integrals import factor_out_constant, integrate_variable_root