Fixed int128 div/mod. Fix WASM memory init priority.

This commit is contained in:
Christoffer Lerno
2024-08-27 04:31:14 +02:00
parent 388578c209
commit 26acce246d
4 changed files with 224 additions and 72 deletions

View File

@@ -0,0 +1,21 @@
module int128_test;
fn void check(uint128 a, uint128 b)
{
uint128 div = a / b;
uint128 mod = a % b;
assert(div * b + mod == a);
}
fn void test_big() @test
{
uint128 a = 12345678901234567890012u128;
uint128 b = 1234567890123456789001u128;
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
check(a + i, b + j);
}
}
}