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
e0a7b3a3
Commit
e0a7b3a3
authored
Jun 16, 2012
by
Taddeus Kroes
Committed by
Taddeüs Kroes
Sep 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integral lower bound now takes over negation fromt parent exponentiation.
parent
703d0888
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
src/parser.py
src/parser.py
+2
-0
tests/test_parser.py
tests/test_parser.py
+1
-1
No files found.
src/parser.py
View file @
e0a7b3a3
...
...
@@ -596,6 +596,7 @@ class Parser(BisonParser):
if
option
==
0
:
# rule: INTEGRAL SUB exp
if
values
[
2
].
is_op
(
OP_POW
):
lbnd
,
ubnd
=
values
[
2
]
lbnd
.
negated
+=
values
[
2
].
negated
else
:
lbnd
=
values
[
2
]
ubnd
=
Leaf
(
INFINITY
)
...
...
@@ -667,6 +668,7 @@ class Parser(BisonParser):
if
bounds
.
is_op
(
OP_POW
):
lbnd
,
ubnd
=
bounds
lbnd
.
negated
+=
bounds
.
negated
else
:
lbnd
=
bounds
ubnd
=
Leaf
(
INFINITY
)
...
...
tests/test_parser.py
View file @
e0a7b3a3
...
...
@@ -168,7 +168,7 @@ class TestParser(RulesTestCase):
self
.
assertEqual
(
tree
(
'int_a x ^ 2 dx'
),
integral
(
x
**
2
,
x
,
a
,
oo
))
self
.
assertEqual
(
tree
(
'int_(-a)^b x dx'
),
integral
(
x
,
x
,
-
a
,
b
))
#self.assertEqual(tree('int_-a^b x dx'), integral(x
, x, -a, b))
self
.
assertEqual
(
tree
(
'int_-a^b x^2 dx'
),
integral
(
x
**
2
,
x
,
-
a
,
b
))
def
test_indefinite_integral
(
self
):
x2
,
a
,
b
,
oo
=
tree
(
'x ^ 2, a, b, oo'
)
...
...
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