bit swap in byte


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8650
Posted: 05:19pm 27 Jul 2022      

b% * &H0202020202 and &H010884422010) mod 1023

would be even faster implemented as a CSUB. Remember the biggest time cost in MMbasic is not the math but parsing the ascii. This is evidenced by integers only being fractionally quicker than double precision floats.
The CSUB has only one parameter so very little to parse hence the speed improvement even with a slower algorithm