|
| From: | Dan Sebald |
| Subject: | [Octave-bug-tracker] [bug #54572] int64 does not saturate correctly in negative direction |
| Date: | Tue, 28 Aug 2018 17:26:19 -0400 (EDT) |
| User-agent: | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0 |
Follow-up Comment #23, bug #54572 (project octave):
Even the __signbit() routine leaves me wondering:
return static_cast<uint64_t> (x) >> std::numeric_limits<int64_t>::digits;
It's bit-shifting with a quantity called digits; presumably digits means
"bits" for int values. Why not just (x < 0) if it is trying to extract the
sign bit? Was this code supposed to account for the case of defining
int64_max to be 2^52 - 1 and int64_min -2^52? That is, to ensure all data
types fit within an IEEE double significand?
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?54572>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
| [Prev in Thread] | Current Thread | [Next in Thread] |