Skip to content

Commit

Permalink
fix bigint to py::int conversion (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje authored Jan 11, 2021
1 parent 9f6b8e9 commit 47eef2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings/python/python-bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ BigInteger to_biginteger(py::int_& value, bool is_bigendian = false) {
}

py::int_ to_py_int(const BigInteger& value, bool is_signed = true, bool is_bigendian = false) {
const auto data = value.to_byte_array(is_signed, is_bigendian);
const auto data = value.to_byte_array(!is_signed, is_bigendian);

auto obj = static_cast<PyObject*>(_PyLong_FromByteArray(data.data(),
data.size(),
Expand All @@ -67,7 +67,7 @@ py::int_ to_py_int(const BigInteger& value, bool is_signed = true, bool is_bigen
return py::reinterpret_steal<py::int_>(obj);
}

static constexpr auto VERSION_BINDINGS = "1.2.1";
static constexpr auto VERSION_BINDINGS = "1.2.2";

PYBIND11_MODULE(pybiginteger, m) {
m.doc() = "A C++ port of the C# BigInteger class";
Expand Down

0 comments on commit 47eef2a

Please sign in to comment.