[bug #68548] dec2base produces incorrect output for multiple negative inputs

chad <[email protected]> Thu, 23 Jul 2026 00:47:44 -0400 (EDT)
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
--===============7223268127779727106==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

UGxlYXNlIHVzZSB0aGUgYnVnIHRyYWNrZXIgdG8gcG9zdCB1cGRhdGVzIHRvIGEgYnVnIHJlcG9y
dC4gIFRoZSBtYWlsaW5nIGxpc3QgaXMgaW50ZW5kZWQgYXMgYSByZWFkLW9ubHkgbm90aWZpY2F0
aW9uIHN0cmVhbS4gIEluZm8gcG9zdGVkIHRvIHRoaXMgbWFpbGluZyBsaXN0IGFkZHJlc3Mgd29u
J3QgYXBwZWFyIGluIHRoZSB0cmFja2VyIGRhdGFiYXNlIHdoZXJlIGl0IGlzIG1vc3QgdXNlZnVs
LgoK

--===============7223268127779727106==
Content-Type: MULTIPART/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; BOUNDARY="8323329-424238335-1784782064=:2450814"
Content-Disposition: inline

--8323329-424238335-1784782064=:2450814
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

URL:=0A  <https://savannah.gnu.org/bugs/?68548>=0A=0A                 Summa=
ry: dec2base produces incorrect output for multiple=0Anegative inputs=0A   =
                Group: GNU Octave=0A               Submitter: chadholton=0A=
               Submitted: Thu 23 Jul 2026 04:47:35 AM UTC=0A               =
 Category: Octave Function=0A                Severity: 3 - Normal=0A       =
         Priority: 5 - Normal=0A              Item Group: Incorrect Result=
=0A                  Status: None=0A             Assigned to: None=0A      =
   Originator Name: chad=0A        Originator Email:=0A             Open/Cl=
osed: Open=0A         Discussion Lock: Unlocked=0A                 Release:=
 11.3.0=0A        Operating System: Any=0A           Fixed Release: None=0A=
         Planned Release: None=0A=0A=0A    ________________________________=
_______________________=0A=0AFollow-up Comments:=0A=0A=0A------------------=
-------------------------------------=0ADate: Thu 23 Jul 2026 04:47:35 AM U=
TC By: chad <chadholton>=0AThe current situation:=0A=0Adec2base([-1, -2], 1=
0, 3, 2)=0A=0Aans =3D=0A=0A998.9A=0A997.9A=0A=0AThis is Octave's own extens=
ion; MATLAB does not have this feature, so I don't=0Aknow the corresponding=
 correct result. But at least it can be seen that the=0Aresult of separate =
input is different from it.=0A=0Adec2base(-1, 10, 3, 2)=0Aans =3D 999.00=0A=
=0Adec2base(-2, 10, 3, 2)=0Aans =3D 998.00=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=
    _______________________________________________________=0A=0AReply to t=
his item at:=0A=0A  <https://savannah.gnu.org/bugs/?68548>=0A=0A___________=
____________________________________=0AMessage sent via Savannah=0Ahttps://=
savannah.gnu.org/=0A
--8323329-424238335-1784782064=:2450814
Content-Type: APPLICATION/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCamGc8AAKCRCqLAuaBUf3
Tt8IAP98XZFhsT4y1tBRbp5s+GxbpAk0RVb6MoX0oUosKNpuXQD/V66dXhKXiVNI
41jFzDFJrQPPpqkBsjOS3sv5aL5z0As=
=BKL2
-----END PGP SIGNATURE-----

--8323329-424238335-1784782064=:2450814--



--===============7223268127779727106==--