Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
e32aa00c
Commit
e32aa00c
authored
Jan 23, 2012
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed missing import and fixed negative multiplication
parent
0fc76d9a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
src/rules/__init__.py
src/rules/__init__.py
+2
-2
src/rules/numerics.py
src/rules/numerics.py
+1
-1
No files found.
src/rules/__init__.py
View file @
e32aa00c
...
...
@@ -5,7 +5,7 @@ from .factors import match_expand
from
.powers
import
match_add_exponents
,
match_subtract_exponents
,
\
match_multiply_exponents
,
match_duplicate_exponent
,
\
match_remove_negative_exponent
,
match_exponent_to_root
from
.numerics
import
match_divide_numerics
from
.numerics
import
match_divide_numerics
,
match_multiply_numerics
from
.fractions
import
match_constant_division
,
match_add_constant_fractions
,
\
match_expand_and_add_fractions
...
...
@@ -13,7 +13,7 @@ from .fractions import match_constant_division, match_add_constant_fractions, \
RULES
=
{
OP_ADD
:
[
match_add_constant_fractions
,
match_combine_polynomes
,
\
match_combine_groups
],
OP_MUL
:
[
match_expand
,
match_add_exponents
,
\
OP_MUL
:
[
match_
multiply_numerics
,
match_
expand
,
match_add_exponents
,
\
match_expand_and_add_fractions
],
OP_DIV
:
[
match_subtract_exponents
,
match_divide_numerics
,
\
match_constant_division
],
...
...
src/rules/numerics.py
View file @
e32aa00c
...
...
@@ -123,7 +123,7 @@ def match_multiply_numerics(node):
if
n
.
is_numeric
():
numerics
.
append
((
n
,
n
.
value
))
elif
n
.
is_op
(
OP_NEG
)
and
n
[
0
].
is_numeric
():
numerics
.
append
((
n
,
n
[
0
].
value
))
numerics
.
append
((
n
,
-
n
[
0
].
value
))
for
(
n0
,
v0
),
(
n1
,
v1
)
in
combinations
(
numerics
,
2
):
p
.
append
(
P
(
node
,
multiply_numerics
,
(
n0
,
n1
,
v0
,
v1
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment