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
56506a6e
Commit
56506a6e
authored
Apr 05, 2010
by
Mark Dickinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a better NaN test in _Py_HashDouble as well.
parent
e1d665a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
Objects/object.c
Objects/object.c
+6
-3
No files found.
Objects/object.c
View file @
56506a6e
...
...
@@ -1025,9 +1025,12 @@ _Py_HashDouble(double v)
* of mapping keys will turn out weird.
*/
if
(
!
Py_IS_FINITE
(
v
))
{
if
(
Py_IS_INFINITY
(
v
))
/* can't convert to long int -- arbitrary */
v
=
v
<
0
?
-
271828
.
0
:
314159
.
0
;
return
v
<
0
?
-
271828
:
314159
;
else
return
0
;
}
fractpart
=
modf
(
v
,
&
intpart
);
if
(
fractpart
==
0
.
0
)
{
/* This must return the same hash as an equal int or long. */
...
...
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