Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pandas/_libs/src/klib/khash_python.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <string.h>
#include <Python.h>

#include "khash.h"
Expand All @@ -14,7 +15,9 @@
// hash for 64 bit integers.
// GH 13436
khint64_t PANDAS_INLINE asint64(double key) {
return *(khint64_t *)(&key);
khint64_t val;
memcpy(&val, &key, sizeof(double));
return val;
}
#define kh_float64_hash_func(key) (khint32_t)((asint64(key))>>33^(asint64(key))^(asint64(key))<<11)
#define kh_float64_hash_equal(a, b) ((a) == (b) || ((b) != (b) && (a) != (a)))
Expand Down