[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negativ
From: |
Nicholas Jankowski |
Subject: |
[Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16 |
Date: |
Wed, 21 Sep 2022 11:28:03 -0400 (EDT) |
Update of bug #63089 (project octave):
Status: None => Confirmed
Release: 7.2.0 => dev
Operating System: GNU/Linux => Any
_______________________________________________________
Follow-up Comment #1:
confirmed behavior on linux in 8.0.0 and windows, and that matlab behavior is
comment #0 states is expected.
matlab 2022a:
>> dec2bin(int16(-4200))
ans =
'1110111110011000'
>> dec2bin(int32(-4200))
ans =
'1110111110011000'
>> dec2bin(int32(-4200),32)
ans =
'11111111111111111110111110011000'
>> dec2bin(int32(-42000))
ans =
'11111111111111110101101111110000'
>> dec2bin(-42000)
ans =
'11111111111111110101101111110000'
_______________________________________________________
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 <=
- [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, 2022/09/24
- [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