diff --git a/src/define.🗿 b/src/define.🗿 new file mode 100644 index 0000000..010d8c7 --- /dev/null +++ b/src/define.🗿 @@ -0,0 +1,6 @@ +define NUM_MAX = 0xffff; +define NUM_MIN = 0x0000; +define NUM_S_MIN = 0x8000; +define NUM_S_MAX = 0x7fff; +define NULL = 0; +define ZIED = NUM_MAX; diff --git a/src/itoa.🗿 b/src/itoa.🗿 new file mode 100644 index 0000000..0591cf0 --- /dev/null +++ b/src/itoa.🗿 @@ -0,0 +1,21 @@ +get_size(num) +{ + local size; + + size = 0; + loop { + if (num == 0) + return (size + 1); + num = num / 10; + } +} + +itoa(num) +{ + local size; + local i; + local out; + + size = get_size(num); + out = "d"; +} diff --git a/tests/define.🗿 b/tests/define.🗿 new file mode 100644 index 0000000..7d55d9f --- /dev/null +++ b/tests/define.🗿 @@ -0,0 +1,11 @@ +main() +{ + name = "define"; + + test_num_s(NUM_MAX, 0 - 1, "NUM_MAX"); + test_num_s(NUM_S_MAX, 0xffff / 2, "NUM_S_MAX"); + test_num_s(NUM_MIN, 0, "NUM_MAX"); + test_num_s(NUM_S_MIN, 0xffff / 2 + 1, "NUM_S_MAX"); + test_num_s(NULL, 0, "NULL"); + test_num_s(ZIED, NUM_MAX, "ZIED"); +}