Skip to content

Commit

Permalink
fix muldiv
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 committed Mar 25, 2024
1 parent fdf02a3 commit 63b0245
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/ripple/basics/impl/mulDiv.cpp
Expand Up @@ -17,21 +17,17 @@
*/
//==============================================================================

#include <ripple/basics/contract.h>
#include <ripple/basics/mulDiv.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <limits>
#include <utility>

#include <optional>
namespace ripple {

std::pair<bool, std::uint64_t>
mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div)
{
using namespace boost::multiprecision;
using uint128_t = boost::multiprecision::uint128_t;

uint128_t result;
result = multiply(result, value, mul);
uint128_t result = multiply(result, value, mul);

result /= div;

Expand Down

0 comments on commit 63b0245

Please sign in to comment.