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
12eebb16
Commit
12eebb16
authored
May 02, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated some comments.
parent
49391e6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/rules/sqrt.py
src/rules/sqrt.py
+5
-1
No files found.
src/rules/sqrt.py
View file @
12eebb16
...
@@ -7,6 +7,10 @@ from ..translate import _
...
@@ -7,6 +7,10 @@ from ..translate import _
def
is_eliminateable_sqrt
(
n
):
def
is_eliminateable_sqrt
(
n
):
"""
Check if the square root of n can be evaluated so that the square root
disappears (is eliminated).
"""
if
isinstance
(
n
,
int
):
if
isinstance
(
n
,
int
):
return
n
>
3
and
int
(
math
.
sqrt
(
n
))
**
2
==
n
return
n
>
3
and
int
(
math
.
sqrt
(
n
))
**
2
==
n
...
@@ -99,7 +103,7 @@ MESSAGES[split_dividers] = _('Write {0[0]} as {1} * {2} to so that {1} can ' \
...
@@ -99,7 +103,7 @@ MESSAGES[split_dividers] = _('Write {0[0]} as {1} * {2} to so that {1} can ' \
def
extract_sqrt_multiplicant
(
root
,
args
):
def
extract_sqrt_multiplicant
(
root
,
args
):
"""
"""
sqrt(ab)
-> sqrt(a)sqrt(b)
sqrt(ab) -> sqrt(a)sqrt(b)
"""
"""
scope
,
a
=
args
scope
,
a
=
args
scope
.
remove
(
a
)
scope
.
remove
(
a
)
...
...
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