[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negativ
From: |
Arun Giridhar |
Subject: |
[Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16 |
Date: |
Sat, 24 Sep 2022 13:45:05 -0400 (EDT) |
Follow-up Comment #6, bug #63089 (project octave):
Improved patch attached (v2).
I activated several BISTs that had been commented out. All BISTs now pass.
I've fixed them to expect 64-bit strings instead of 53-bit ones, and to allow
numbers down to -2^63 without expecting an error.
The practice of left-padding with ones for negative inputs is standard two's
complement notation, but the practice of further left-padding that with zeroes
is not mathematically sound at all. Is Matlab still doing that or have they
fixed it to consistently left-pad with ones for all negative inputs? In any
case, I've added a note to the docstring explaining what to expect.
Since the domain of valid inputs has changed, should we mention this in NEWS?
If so, is it going into 7.3 or 8?
(file #53748)
_______________________________________________________
Additional Item Attachment:
File name: dec2bin.patch_v2 Size:5 KB
<https://file.savannah.gnu.org/file/dec2bin.patch_v2?file_id=53748>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63089>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Mayeul Cantan, 2022/09/21
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Nicholas Jankowski, 2022/09/21
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Mayeul Cantan, 2022/09/21
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Markus Mützel, 2022/09/23
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Nicholas Jankowski, 2022/09/23
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Arun Giridhar, 2022/09/24
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16,
Arun Giridhar <=
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Arun Giridhar, 2022/09/24
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, A.R. Burgers, 2022/09/24
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Arun Giridhar, 2022/09/25
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Arun Giridhar, 2022/09/28
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Markus Mützel, 2022/09/29
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Arun Giridhar, 2022/09/29
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Arun Giridhar, 2022/09/29
- [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16, Markus Mützel, 2022/09/29