Files
c3c/test/unit/regression/int128.c3
Christoffer Lerno abe4727c3a Deprecate uXX and iXX bit suffixes.
Add experimental LL / ULL suffixes for int128 and uint128 literals.
2025-05-13 23:48:59 +02:00

22 lines
344 B
Plaintext

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 = 12345678901234567890012ULL;
uint128 b = 1234567890123456789001ULL;
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
check(a + i, b + j);
}
}
}