Livt packages

Eccelerators.BitTwiddling

Version 0.1.1

Readable 32-bit bit manipulation, counting, scanning, permutation, and arithmetic utilities for Livt.

Published files (26)

tests/permutation/MortonCodesTest.lvt

namespace Eccelerators.BitTwiddling.Tests.Permutation

using Eccelerators.BitTwiddling.Permutation

@Test
component MortonCodesTest
{
    @Test
    fn TestInterleave16()
    {
        assert MortonCodes.Interleave16(0, 0) == (0 as uint)
        assert MortonCodes.Interleave16(1, 0) == (1 as uint)
        assert MortonCodes.Interleave16(0, 1) == (2 as uint)
        assert MortonCodes.Interleave16(1, 1) == (3 as uint)
        assert MortonCodes.Interleave16(0xFFFF, 0) == (0x55555555 as uint)
        assert MortonCodes.Interleave16(0, 0xFFFF) == (0xAAAAAAAA as uint)
        assert MortonCodes.Interleave16(0xFFFF, 0xFFFF) == (0xFFFFFFFF as uint)
    }
}