mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
15 lines
324 B
C
15 lines
324 B
C
module copysign @test;
|
|
import std::math;
|
|
fn void copysign_float()
|
|
{
|
|
float a = 3;
|
|
float b = -4;
|
|
float c = math::copysign(a, b);
|
|
assert(c == -3);
|
|
float d = math::copysign(a, 3);
|
|
assert(d == 3);
|
|
assert(math::copysign(a, -3) == -3);
|
|
float e = math::copysign(3, a);
|
|
assert(e == 3);
|
|
assert(math::copysign(3, b) == -3);
|
|
} |