Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13109: Incorrect result when casting from multiprecision::uint128_t to unsigned long long.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-12-30 18:17:48
#13109: Incorrect result when casting from multiprecision::uint128_t to unsigned
long long.
-------------------------------+----------------------------
Reporter: gvisser@⦠| Owner: John Maddock
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: multiprecision
Version: Boost 1.63.0 | Severity: Problem
Resolution: fixed | Keywords:
-------------------------------+----------------------------
Changes (by John Maddock):
* status: new => closed
* resolution: => fixed
Comment:
The intended behaviour is to return the maximum value of the target type
when a narrowing conversion overflows (I realise this is different
behaviour to most built in integer types, but then you're into undefined
behaviour).
This patch:
https://github.com/boostorg/multiprecision/commit/b35f1c8f613db66ad80ce260f94b7027814ede71
enforces uniform behaviour across all backend integer types.
In future, if you really want just the low order N bits, then you will
need to mask these out - the same is true of built in integers actually if
you want to avoid code-sanitizer errors (cland usan etc).
-- Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13109#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-12-30 18:23:03 UTC