Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Kirill Smelkov
cpython
Commits
cd9dd379
Commit
cd9dd379
authored
May 10, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #11888: skip some log2 tests on Mac OS X Tiger
System log2() is not accurate for exact power of 2.
parent
74b4885c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
Lib/test/test_math.py
Lib/test/test_math.py
+11
-4
No files found.
Lib/test/test_math.py
View file @
cd9dd379
...
...
@@ -5,6 +5,7 @@ from test.support import run_unittest, verbose, requires_IEEE_754
import
unittest
import
math
import
os
import
platform
import
sys
import
struct
import
sysconfig
...
...
@@ -652,10 +653,6 @@ class MathTests(unittest.TestCase):
@
requires_IEEE_754
def
testLog2
(
self
):
self
.
assertRaises
(
TypeError
,
math
.
log2
)
# Check that we get exact equality for log2 of powers of 2.
actual
=
[
math
.
log2
(
math
.
ldexp
(
1.0
,
n
))
for
n
in
range
(
-
1074
,
1024
)]
expected
=
[
float
(
n
)
for
n
in
range
(
-
1074
,
1024
)]
self
.
assertEqual
(
actual
,
expected
)
# Check some integer values
self
.
assertEqual
(
math
.
log2
(
1
),
0.0
)
...
...
@@ -671,6 +668,16 @@ class MathTests(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
math
.
log2
,
NINF
)
self
.
assertTrue
(
math
.
isnan
(
math
.
log2
(
NAN
)))
@
requires_IEEE_754
@
unittest
.
skipIf
(
sys
.
platform
==
'darwin'
and
platform
.
mac_ver
()[
0
].
startswith
(
'10.4.'
),
'Mac OS X Tiger log2() is not accurate enough'
)
def
testLog2Exact
(
self
):
# Check that we get exact equality for log2 of powers of 2.
actual
=
[
math
.
log2
(
math
.
ldexp
(
1.0
,
n
))
for
n
in
range
(
-
1074
,
1024
)]
expected
=
[
float
(
n
)
for
n
in
range
(
-
1074
,
1024
)]
self
.
assertEqual
(
actual
,
expected
)
def
testLog10
(
self
):
self
.
assertRaises
(
TypeError
,
math
.
log10
)
self
.
ftest
(
'log10(0.1)'
,
math
.
log10
(
0.1
),
-
1
)
...
...
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