[bug #68548] dec2base produces incorrect output for multiple negative inputs
Arun Giridhar <[email protected]> Thu, 23 Jul 2026 13:21:36 -0400 (EDT)
| Newsgroups | gmane.comp.gnu.octave.bugs |
|---|---|
| Message-ID | <[email protected]> |
--===============7179487686875012299==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
UGxlYXNlIHVzZSB0aGUgYnVnIHRyYWNrZXIgdG8gcG9zdCB1cGRhdGVzIHRvIGEgYnVnIHJlcG9y
dC4gIFRoZSBtYWlsaW5nIGxpc3QgaXMgaW50ZW5kZWQgYXMgYSByZWFkLW9ubHkgbm90aWZpY2F0
aW9uIHN0cmVhbS4gIEluZm8gcG9zdGVkIHRvIHRoaXMgbWFpbGluZyBsaXN0IGFkZHJlc3Mgd29u
J3QgYXBwZWFyIGluIHRoZSB0cmFja2VyIGRhdGFiYXNlIHdoZXJlIGl0IGlzIG1vc3QgdXNlZnVs
LgoK
--===============7179487686875012299==
Content-Type: MULTIPART/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; BOUNDARY="8323329-424238335-1784827296=:1885628"
Content-Disposition: inline
--8323329-424238335-1784827296=:1885628
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline
Update of bug #68548 (group octave):=0A=0A Status: =
None =3D> Fixed=0A Assigned to: =
None =3D> arungiridhar=0A Open/Closed: Open =
=3D> Closed=0A Fixed Release: None =3D> 11.4.0=
(current stable)=0A Planned Release: None =3D> =
11.4.0 (current stable)=0A=0A __________________________________________=
_____________=0A=0AFollow-up Comment #1:=0A=0AThanks for reporting this bug=
. It was the result of a silly typo that I made=0Ain Feb 2023. A certain ex=
pression should have said "foo(k, j)" but I had=0Awritten only "foo(j)". Fo=
r scalar inputs this was the same index, but for=0Avectors it was very diff=
erent and messing up the result.=0A=0AI've pushed the fix to the stable bra=
nch (hg id 395a6ecca13f) and added your=0Aexample as a BIST. The fix will s=
how up in the next Octave release.=0A=0ANew result:=0A=0Aoctave:1> test dec=
2base=0APASSES 49 out of 49 tests=0A=0Aoctave:2> dec2base ([-1 -2], 10, 3, =
2)=0Aans =3D=0A999.00=0A998.00=0A=0Aoctave:3> dec2base (-1, 10, 3, 2)=0Aans=
=3D 999.00=0A=0Aoctave:4> dec2base (-2, 10, 3, 2)=0Aans =3D 998.00=0A=0A=
=0A=0AClosing as fixed.=0A=0A=0A _______________________________________=
________________=0A=0AReply to this item at:=0A=0A <https://savannah.gnu.o=
rg/bugs/?68548>=0A=0A_______________________________________________=0AMess=
age sent via Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-424238335-1784827296=:1885628
Content-Type: APPLICATION/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCamJNoAAKCRCqLAuaBUf3
TtP0AQDYsJOXseCfLbYqT190am0tyj+uszDIAS8lvuBMqPJpKwEAu7XsqSa7+vl4
NT64iHgaDHfWFvFyYha+i9SOYFAcfgs=
=nLyR
-----END PGP SIGNATURE-----
--8323329-424238335-1784827296=:1885628--
--===============7179487686875012299==--