On Mon, 15 Apr 2019, Liu Hao wrote:
在 2019/4/15 20:52, Martin Storsjö 写道:
---
mingw-w64-crt/Makefile.am | 18 ++++++++++++++++++
mingw-w64-crt/math/arm-common/acosh.c | 16 ++++++++++++++++
mingw-w64-crt/math/arm-common/acoshf.c | 16 ++++++++++++++++
mingw-w64-crt/math/arm-common/acoshl.c | 16 ++++++++++++++++
mingw-w64-crt/math/arm-common/asinh.c | 18 ++++++++++++++++++
mingw-w64-crt/math/arm-common/asinhf.c | 18 ++++++++++++++++++
mingw-w64-crt/math/arm-common/asinhl.c | 16 ++++++++++++++++
mingw-w64-crt/math/arm-common/atanh.c | 17 +++++++++++++++++
mingw-w64-crt/math/arm-common/atanhf.c | 17 +++++++++++++++++
mingw-w64-crt/math/arm-common/atanhl.c | 16 ++++++++++++++++
10 files changed, 168 insertions(+)
create mode 100644 mingw-w64-crt/math/arm-common/acosh.c
create mode 100644 mingw-w64-crt/math/arm-common/acoshf.c
create mode 100644 mingw-w64-crt/math/arm-common/acoshl.c
create mode 100644 mingw-w64-crt/math/arm-common/asinh.c
create mode 100644 mingw-w64-crt/math/arm-common/asinhf.c
create mode 100644 mingw-w64-crt/math/arm-common/asinhl.c
create mode 100644 mingw-w64-crt/math/arm-common/atanh.c
create mode 100644 mingw-w64-crt/math/arm-common/atanhf.c
create mode 100644 mingw-w64-crt/math/arm-common/atanhl.c
diff --git a/mingw-w64-crt/math/arm-common/asinh.c
b/mingw-w64-crt/math/arm-common/asinh.c
new file mode 100644
index 000000000..8db2cc90e
--- /dev/null
+++ b/mingw-w64-crt/math/arm-common/asinh.c
@@ -0,0 +1,18 @@
+/**
+ * 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>
+
+double asinh(double x)
+{
+ if (isinf(x*x + 1)) {
+ if (x > 0)
+ return log(2) + log(x);
+ else
+ return log(2) - log(-x);
This should be `return -log(2) - log(-x)`.
Will change
+}
diff --git a/mingw-w64-crt/math/arm-common/atanh.c
b/mingw-w64-crt/math/arm-common/atanh.c
new file mode 100644
index 000000000..08302c0e2
--- /dev/null
+++ b/mingw-w64-crt/math/arm-common/atanh.c
@@ -0,0 +1,17 @@
+/**
+ * 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>
+
+double atanh(double x)
+{
+ if (x > 1 || x < -1)
This should be `if (x >= 1 || x <= -1)`.
No, according to the doc I read, 1 or -1 should return inf/-inf, not nan.
The default code below achieves that.
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public