[bug #68062] __marching_cube__.m should not rely on "bitget()" returning "logical"

"Dmitri A. Sergatskov" <[email protected]>
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

URL:
  <https://savannah.gnu.org/bugs/?68062>

                 Summary: __marching_cube__.m should not rely on "bitget()"
returning "logical"
                   Group: GNU Octave
               Submitter: dasergatskov
               Submitted: Tue 17 Feb 2026 11:37:55 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Unlocked
                 Release: dev
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 17 Feb 2026 11:37:55 PM UTC By: Dmitri A. Sergatskov <dasergatskov>
__marching_cube__.m has a code that relies on "bitget()" function returning
"logical" type. Th is the case now, but not with Matlab-compatible "bitget()"
where return type is the same as input type ("uint16" in this particular
case). The diff:

diff -r 290f6519b733 scripts/plot/draw/private/__marching_cube__.m
--- a/scripts/plot/draw/private/__marching_cube__.m     Mon Feb 16 11:31:33
2026 +0100
+++ b/scripts/plot/draw/private/__marching_cube__.m     Tue Feb 17 18:32:53
2026 -0500
@@ -157,7 +157,8 @@
   ccedge = [vec(cedge(id)), id];
   ix_offset=0;
   for jj = 1:12
-    id__ = bitget (ccedge(:, 1), jj);
+    ## Make sure "id__" is logical egardless of "bitget" return type.
+    id__ = logical (bitget (ccedge(:, 1), jj));
     id_ = ccedge(id__, 2);
     [ix iy iz] = ind2sub (size (cc), id_);
     id_c = sub2ind (size (v), ix, iy, iz);

fixes that for me.

Dmitri.
-- 








    _______________________________________________________

Reply to this item at:

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

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaZT71wAKCRCqLAuaBUf3
Trk1AQD8PtinzH9mAoUneO5j12OpQL0doUHSTGg1Shfz1tWSTQD/Q03sVQuCUFfD
fxiDKYuVZE7lc/aC4BFLtfDSYZ9b6wg=
=m2pU
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.