Support roundevenf/roundeven

This commit is contained in:
Christoffer Lerno
2023-01-14 15:24:49 +01:00
parent 925e4e6e46
commit 6da6288ad8
2 changed files with 14 additions and 1 deletions

13
lib/std/math_builtin.c3 Normal file
View File

@@ -0,0 +1,13 @@
module std::math;
fn float __roundevenf(float f) @extname("roundevenf") @weak
{
// Slow implementation
return round(f / 2) * 2;
}
fn double __roundeven(double d) @extname("roundeven") @weak
{
// Slow implementation
return round(d / 2) * 2;
}