octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #58147] Matlab 2020 compatibility: dec2bin, de


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #58147] Matlab 2020 compatibility: dec2bin, dec2hex shouldn't error on negative inputs
Date: Thu, 9 Apr 2020 12:10:12 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36

Follow-up Comment #1, bug #58147 (project octave):

noting that the public facing help for both matlab functions explain the
output:

Starting in R2020a, the dec2bin function converts negative numbers using their
two's complement binary values.

For example, these calls to dec2bin convert negative numbers.

dec2bin(-1)
ans = 
'11111111'
dec2bin(-16)
ans = 
'11110000'


and the same for dec2hex:

dec2hex(-1)
ans = 
'FF'
dec2hex(-16)
ans = 
'F0'


dec2base still states that the input must be non-negative

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58147>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]