Solve bug with parenthesis and ^
This commit is contained in:
parent
e0fb4da8ef
commit
c81776e037
@ -19,7 +19,7 @@ class Pw(Operator):
|
|||||||
>>> pw.__tex__('2','-3')
|
>>> pw.__tex__('2','-3')
|
||||||
'2^{ -3 }'
|
'2^{ -3 }'
|
||||||
>>> pw.__tex__('-2','3')
|
>>> pw.__tex__('-2','3')
|
||||||
'( -2 )^{ -3 }'
|
'( -2 )^{ 3 }'
|
||||||
>>> pw.__txt__('2','3')
|
>>> pw.__txt__('2','3')
|
||||||
'2 ^ 3'
|
'2 ^ 3'
|
||||||
>>> pw.__txt__('-2','3')
|
>>> pw.__txt__('-2','3')
|
||||||
@ -66,6 +66,19 @@ class Pw(Operator):
|
|||||||
ans = ' '.join([str(i) for i in ans])
|
ans = ' '.join([str(i) for i in ans])
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
def __tex__(self, *args):
|
||||||
|
"""Tex rendering for ^
|
||||||
|
|
||||||
|
:*args: Operands for this operation
|
||||||
|
:returns: String with operator and his operands
|
||||||
|
|
||||||
|
"""
|
||||||
|
op1 = self.l_parenthesis(args[0], True)
|
||||||
|
op2 = args[1]
|
||||||
|
ans = self.tex.format(op1 = op1, op2 = op2)
|
||||||
|
|
||||||
|
return ans
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# Reglages pour 'vim'
|
# Reglages pour 'vim'
|
||||||
|
Loading…
Reference in New Issue
Block a user