mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
16 lines
362 B
Plaintext
16 lines
362 B
Plaintext
module std::math::nolibc @if(env::NO_LIBC || $feature(C3_MATH));
|
|
|
|
fn double _fabs(double x) @weak @cname("fabs") @nostrip
|
|
{
|
|
ulong ix = bitcast(x, ulong);
|
|
ix &= ~(1ul << 63);
|
|
return bitcast(ix, double);
|
|
}
|
|
|
|
fn float _fabsf(float x) @weak @cname("fabsf") @nostrip
|
|
{
|
|
uint ix = bitcast(x, uint);
|
|
ix &= 0x7fffffff;
|
|
return bitcast(ix, float);
|
|
}
|