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

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

[Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negativ


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #63089] dec2bin gives wrong answer for negative int16
Date: Tue, 25 Oct 2022 12:10:20 -0400 (EDT)

Follow-up Comment #21, bug #63089 (project octave):

Looks mostly good to me.
Just some minor remarks:
- The error message should probably use plural "integers" (like in dec2base).
- Lines with function calls should end with a semicolon. It doesn't matter if
those functions return arguments or not (like "error" in line 29 of your
patch).

With these modifications, the patch is good to go on stable imho. For the
default branch, we could try to avoid having double input validation for
positive input (once in dec2bin and then again in dec2base). Maybe, we could
split the actual work in dec2base from the input validation. That "core"
function could be a private `__dec2base__` function (which wouldn't contain
any input validation). Both, dec2bin and dec2base could call that private
"core" function.



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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