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

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

[Octave-bug-tracker] [bug #63282] Make dec2base accept negative and/or f


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #63282] Make dec2base accept negative and/or fractional inputs
Date: Thu, 23 Feb 2023 09:19:39 -0500 (EST)

Follow-up Comment #4, bug #63282 (project octave):

Interestingly enough, the patch to make *dec2base* accept negative numbers
(the subject of this bug report before the digression about dec2bin) DOES
process negative numbers correctly:


octave:10> dec2base (-3, 2, 9)    # base-2, 9-digit output
ans = 111111101
octave:11> dec2base (-3, 16, 3)   # base-16, 3-digit output
ans = FFD


If you try that with unpatched Octave you'll get an error.

Anyway, I am attaching an updated patch (no new features to dec2base compared
to comment #0, just basing it against current default after 6 months.

The aim of this patch is to make dec2bin and dec2hex both use dec2base which
would centralize all validation and conversion in one consistent place.

(file #54390)

    _______________________________________________________

Additional Item Attachment:

File name: dec2base.patch                 Size:7 KB
    <https://file.savannah.gnu.org/file/dec2base.patch?file_id=54390>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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