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

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

[Octave-bug-tracker] [bug #59466] [octave forge] (communications) de2bi


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #59466] [octave forge] (communications) de2bi improper input handling
Date: Mon, 16 Nov 2020 14:00:15 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36

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

ok.  wrote up a quick patch that that redoes the input handling to fix the
'MSB with only two inputs' bug, it now allows empty inputs for n and/or p. It
also happens to be compatible with matlab behavior where the MSB flag can
occur in position 2, 3, or 4.  

I left in n being any value, including 0 or negative, but added an input check
on p.  It could previously be any number, but after checking the p=0 and p=1
cases just produce errors or erroneous output depending on other options
chosen, and while negative p values have a mathematical meaning in
negative-base expansion, the output wasn't following those rules.  So I added
a p>1 check. Added BISTS for the changes, seems to pass them all now.

I looked at bi2de, but with only 3 inputs, it seemed to have it all covered,
so didn't see any need for changes.  

patch and modified m-file for di2be attached. also made a note in the NEWS
file.


(file #50285, file #50286)
    _______________________________________________________

Additional Item Attachment:

File name: di2be_input_patch.diff         Size:4 KB
    <https://file.savannah.gnu.org/file/di2be_input_patch.diff?file_id=50285>

File name: de2bi.m                        Size:3 KB
    <https://file.savannah.gnu.org/file/de2bi.m?file_id=50286>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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