mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 11:17:13 +08:00
Serialize Python floats properly as doubles. (#14)
This commit is contained in:
committed by
Philipp Moritz
parent
5ac2df4329
commit
d469366c75
@@ -64,7 +64,7 @@ Status append(PyObject* elem, SequenceBuilder& builder,
|
||||
if (PyBool_Check(elem)) {
|
||||
RETURN_NOT_OK(builder.AppendBool(elem == Py_True));
|
||||
} else if (PyFloat_Check(elem)) {
|
||||
RETURN_NOT_OK(builder.AppendFloat(PyFloat_AS_DOUBLE(elem)));
|
||||
RETURN_NOT_OK(builder.AppendDouble(PyFloat_AS_DOUBLE(elem)));
|
||||
} else if (PyLong_Check(elem)) {
|
||||
int overflow = 0;
|
||||
int64_t data = PyLong_AsLongLongAndOverflow(elem, &overflow);
|
||||
|
||||
Reference in New Issue
Block a user