Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
a5474b1c
Commit
a5474b1c
authored
Aug 13, 2015
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable test_float, hard code the sys.float_info for now
parent
23e7e565
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
from_cpython/Lib/test/test_float.py
from_cpython/Lib/test/test_float.py
+11
-11
No files found.
from_cpython/Lib/test/test_float.py
View file @
a5474b1c
# expected: fail
import
unittest
,
struct
import
os
from
test
import
test_support
...
...
@@ -79,7 +77,9 @@ class GeneralFloatCases(unittest.TestCase):
# Check that floats within the range of an int convert to type
# int, not long. (issue #11144.)
boundary
=
float
(
sys
.
maxint
+
1
)
epsilon
=
2
**-
sys
.
float_info
.
mant_dig
*
boundary
# TODO: hard code for now, need fix then finish the sys.
epsilon
=
2
**
53
*
boundary
# epsilon = 2**-sys.float_info.mant_dig * boundary
# These 2 floats are either side of the positive int/long boundary on
# both 32-bit and 64-bit systems.
...
...
@@ -427,14 +427,14 @@ class GeneralFloatCases(unittest.TestCase):
# and validate signs. Tests currently disabled, since
# they fail on systems where a subnormal result from pow
# is flushed to zero (e.g. Debian/ia64.)
#
self.assertTrue(0.0 < pow_op(0.5, 1048) < 1e-315)
#
self.assertTrue(0.0 < pow_op(-0.5, 1048) < 1e-315)
#
self.assertTrue(0.0 < pow_op(0.5, 1047) < 1e-315)
#
self.assertTrue(0.0 > pow_op(-0.5, 1047) > -1e-315)
#
self.assertTrue(0.0 < pow_op(2.0, -1048) < 1e-315)
#
self.assertTrue(0.0 < pow_op(-2.0, -1048) < 1e-315)
#
self.assertTrue(0.0 < pow_op(2.0, -1047) < 1e-315)
#
self.assertTrue(0.0 > pow_op(-2.0, -1047) > -1e-315)
self
.
assertTrue
(
0.0
<
pow_op
(
0.5
,
1048
)
<
1e-315
)
self
.
assertTrue
(
0.0
<
pow_op
(
-
0.5
,
1048
)
<
1e-315
)
self
.
assertTrue
(
0.0
<
pow_op
(
0.5
,
1047
)
<
1e-315
)
self
.
assertTrue
(
0.0
>
pow_op
(
-
0.5
,
1047
)
>
-
1e-315
)
self
.
assertTrue
(
0.0
<
pow_op
(
2.0
,
-
1048
)
<
1e-315
)
self
.
assertTrue
(
0.0
<
pow_op
(
-
2.0
,
-
1048
)
<
1e-315
)
self
.
assertTrue
(
0.0
<
pow_op
(
2.0
,
-
1047
)
<
1e-315
)
self
.
assertTrue
(
0.0
>
pow_op
(
-
2.0
,
-
1047
)
>
-
1e-315
)
@
requires_setformat
...
...
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