Opened 9 years ago

Closed 8 years ago

#9936 closed Bugs (fixed)

multiprecision assign does not deal addequately with sign

Reported by: cerquide@… Owned by: John Maddock
Milestone: To Be Determined Component: multiprecision
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

The following code provides the output:

0

-0

Looks like the positive sign is not set after assign is called.

#include <iostream>
#include <boost/multiprecision/cpp_int.hpp>

boost::multiprecision::int128_t x("0");

int main(int argc , char **argv) {
  std::cout << x << std::endl;
  x = -1;
  x.assign("0");
  std::cout << x << std::endl;
}

Change History (4)

comment:1 by viboes, 9 years ago

Component: Nonemultiprecision
Owner: set to John Maddock

comment:2 by John Maddock, 8 years ago

I'm unable to reproduce by either current Git develop or Boost-1.55, which compiler/platform is this?

comment:3 by John Maddock, 8 years ago

Never mind, I've reproduced, testing fix now.

comment:4 by John Maddock, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.