mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
libzigc: roundl
This commit is contained in:
committed by
Andrew Kelley
parent
2b19134c86
commit
e60ba21114
Vendored
-26
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the mingw-w64 runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
#include <math.h>
|
||||
|
||||
long double
|
||||
roundl (long double x)
|
||||
{
|
||||
long double res = 0.0L;
|
||||
if (x >= 0.0L)
|
||||
{
|
||||
res = ceill (x);
|
||||
if (res - x > 0.5L)
|
||||
res -= 1.0L;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = ceill (-x);
|
||||
if (res + x > 0.5L)
|
||||
res -= 1.0L;
|
||||
res = -res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
#include <math.h>
|
||||
|
||||
#if defined(__HTM__) || __ARCH__ >= 9
|
||||
|
||||
long double roundl(long double x)
|
||||
{
|
||||
__asm__ ("fixbra %0, 1, %1, 4" : "=f"(x) : "f"(x));
|
||||
return x;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include "../roundl.c"
|
||||
|
||||
#endif
|
||||
@@ -936,7 +936,6 @@ const mingw32_x86_src = [_][]const u8{
|
||||
"math" ++ path.sep_str ++ "lrintl.c",
|
||||
"math" ++ path.sep_str ++ "lroundl.c",
|
||||
"math" ++ path.sep_str ++ "rintl.c",
|
||||
"math" ++ path.sep_str ++ "roundl.c",
|
||||
"math" ++ path.sep_str ++ "tgammal.c",
|
||||
"math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "_chgsignl.S",
|
||||
"math" ++ path.sep_str ++ "x86" ++ path.sep_str ++ "acoshl.c",
|
||||
|
||||
@@ -1023,7 +1023,6 @@ const src_files = [_][]const u8{
|
||||
"musl/src/math/riscv64/fmaf.c",
|
||||
"musl/src/math/round.c",
|
||||
"musl/src/math/roundf.c",
|
||||
"musl/src/math/roundl.c",
|
||||
"musl/src/math/s390x/fma.c",
|
||||
"musl/src/math/s390x/fmaf.c",
|
||||
"musl/src/math/s390x/nearbyint.c",
|
||||
@@ -1034,7 +1033,6 @@ const src_files = [_][]const u8{
|
||||
"musl/src/math/s390x/rintl.c",
|
||||
"musl/src/math/s390x/round.c",
|
||||
"musl/src/math/s390x/roundf.c",
|
||||
"musl/src/math/s390x/roundl.c",
|
||||
"musl/src/math/scalb.c",
|
||||
"musl/src/math/scalbf.c",
|
||||
"musl/src/math/scalbln.c",
|
||||
|
||||
@@ -810,7 +810,6 @@ const libc_top_half_src_files = [_][]const u8{
|
||||
"musl/src/math/rintl.c",
|
||||
"musl/src/math/round.c",
|
||||
"musl/src/math/roundf.c",
|
||||
"musl/src/math/roundl.c",
|
||||
"musl/src/math/scalb.c",
|
||||
"musl/src/math/scalbf.c",
|
||||
"musl/src/math/scalbln.c",
|
||||
|
||||
+1
-1
@@ -298,7 +298,7 @@ pub fn addCases(cases: *tests.LibcContext) void {
|
||||
// cases.addLibcTestCase("math/rintl.c", true, .{});
|
||||
// cases.addLibcTestCase("math/round.c", true, .{});
|
||||
// cases.addLibcTestCase("math/roundf.c", true, .{});
|
||||
// cases.addLibcTestCase("math/roundl.c", true, .{});
|
||||
cases.addLibcTestCase("math/roundl.c", true, .{});
|
||||
cases.addLibcTestCase("math/scalb.c", true, .{});
|
||||
cases.addLibcTestCase("math/scalbf.c", true, .{});
|
||||
cases.addLibcTestCase("math/scalbln.c", true, .{});
|
||||
|
||||
Reference in New Issue
Block a user