While studying your implementation using the simple for loop in the file morton3D.h I noticed that on line 129 of m3D_e_for the loop is implemented as
for (unsigned int i = 0; i < checkbits; ++i) {
while the corresponding m#D_e_for on line 253 is implemented as
for (unsigned int i = 0; i <= checkbits; ++i) {
while I haven't run your code I can confirm that when doing a port of the functions into a C# project I needed to change both loops to use i < checkbits before I could get my round trip tests to pass.
While studying your implementation using the simple for loop in the file morton3D.h I noticed that on line 129 of m3D_e_for the loop is implemented as
for (unsigned int i = 0; i < checkbits; ++i) {
while the corresponding m#D_e_for on line 253 is implemented as
for (unsigned int i = 0; i <= checkbits; ++i) {
while I haven't run your code I can confirm that when doing a port of the functions into a C# project I needed to change both loops to use
i < checkbits
before I could get my round trip tests to pass.