Files
mercury/tests/hard_coded/array_gen.exp
Zoltan Somogyi 94fadf1797 Add uint versions of array operations.
library/array.m:
    Add uint versions of most of this module's operations.

NEWS.md:
    Mention the new operations.

library/edit_distance.m:
    Use the new array operations to eliminate some casts.

library/edit_seq.m:
    Minor style fix.

tests/hard_coded/array_gen.{m,exp}:
tests/hard_coded/array_test_2.{m,exp}:
    Extend the tests of array.m's operations to the corresponding uint
    versions. Expect the output for the new versions.

tests/hard_coded/array_resize.m:
tests/hard_coded/array_shrink.m:
    Extend the tests of array.m's operations to the corresponding uint
    versions, but generate output only if their results differ from the
    original int versions. (They don't differ.)

tests/hard_coded/array_primitives.m:
    Style fixes.
2026-01-08 03:47:09 +11:00

25 lines
530 B
Plaintext

ArrayI0 = array([0, 2, 4, 6, 8, 10, 12, 14, 16, 18])
ArrayI[0] = 0
ArrayI[1] = 3
ArrayI[2] = 6
ArrayI[3] = 9
ArrayI[4] = 12
ArrayI[5] = 15
ArrayI[6] = 18
ArrayI[7] = 21
ArrayI[8] = 24
ArrayI[9] = 27
ArrayI = array([0, 3, 6, 9, 12, 15, 18, 21, 24, 27])
ArrayU0 = array([0u, 4u, 8u, 12u, 16u, 20u, 24u, 28u, 32u, 36u])
ArrayU[0] = 0
ArrayU[1] = 5
ArrayU[2] = 10
ArrayU[3] = 15
ArrayU[4] = 20
ArrayU[5] = 25
ArrayU[6] = 30
ArrayU[7] = 35
ArrayU[8] = 40
ArrayU[9] = 45
ArrayU = array([0u, 5u, 10u, 15u, 20u, 25u, 30u, 35u, 40u, 45u])