We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c4b9f9 commit 8114dbcCopy full SHA for 8114dbc
ext/numo/narray/numo/types/xint_macro.h
@@ -3,8 +3,9 @@
3
4
#define m_extract(x) m_data_to_num(*(dtype*)(x))
5
6
-#define m_from_double(x) (x)
7
-#define m_from_real(x) (x)
+/* Handle negative values consistently across platforms for unsigned integer types */
+#define m_from_double(x) ((x) < 0 ? (dtype)((long long)(x)) : (dtype)(x))
8
+#define m_from_real(x) ((x) < 0 ? (dtype)((long long)(x)) : (dtype)(x))
9
#define m_from_sint(x) (x)
10
#define m_from_int32(x) (x)
11
#define m_from_int64(x) (x)
0 commit comments