From 6da6288ad87631a359e8663cd96568e07f26040b Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sat, 14 Jan 2023 15:24:49 +0100 Subject: [PATCH] Support roundevenf/roundeven --- lib/std/math_builtin.c3 | 13 +++++++++++++ src/version.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 lib/std/math_builtin.c3 diff --git a/lib/std/math_builtin.c3 b/lib/std/math_builtin.c3 new file mode 100644 index 000000000..908e88c03 --- /dev/null +++ b/lib/std/math_builtin.c3 @@ -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; +} diff --git a/src/version.h b/src/version.h index c895b5092..900da2d32 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define COMPILER_VERSION "0.4.12" \ No newline at end of file +#define COMPILER_VERSION "0.4.13" \ No newline at end of file