mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add math::@ceil() compile time ceil function. #2134
This commit is contained in:
@@ -322,6 +322,18 @@ fn void test_ceil() @test
|
||||
assert(math::ceil(vec) == (double[<5>]) { -123, 124, 1, 0, 0 });
|
||||
}
|
||||
|
||||
fn void test_ct_ceil() @test
|
||||
{
|
||||
$assert(math::@ceil(-123.1) == -123.0);
|
||||
$assert(math::@ceil(123.1) == 124.0);
|
||||
$assert(math::@ceil(0.1) == 1.0);
|
||||
$assert(math::@ceil(-0.9) == 0.0);
|
||||
$assert(math::@ceil(-123.1f) == -123.0f);
|
||||
$assert(math::@ceil(123.1f) == 124.0f);
|
||||
$assert(math::@ceil(0.1f) == 1.0f);
|
||||
$assert(math::@ceil(-0.9f) == 0.0f);
|
||||
}
|
||||
|
||||
fn void test_cos() @test
|
||||
{
|
||||
int [<5>] in = { 231, 1, 0, -1, -231 };
|
||||
|
||||
Reference in New Issue
Block a user