[PATCH 4/5 v2] msvcr120: Add acosh.
Alex Henrie
alexhenrie24 at gmail.com
Wed Jul 12 10:15:33 CDT 2017
/*********************************************************************
+ * acosh (MSVCR120.@)
+ */
+double CDECL MSVCR120_acosh(double x)
+{
+ if (x < 1) {
+ *MSVCRT__errno() = MSVCRT_EDOM;
+ return NAN;
+ }
+#ifdef HAVE_ACOSH
+ return acosh(x);
+#else
+ if (!isfinite(x*x)) return log(2) + log(x);
+ return log(x + sqrt(x*x-1));
+#endif
+}
+
+/*********************************************************************
+ * acoshf (MSVCR120.@)
+ */
+float CDECL MSVCR120_acoshf(float x)
+{
+#ifdef HAVE_ACOSHF
+ return acoshf(x);
+#else
+ return MSVCR120_acosh(x);
+#endif
+}
Thanks for the help. Are you sure that acosh and atanh require bounds
checking, but acoshf and atanhf do not? Also, aren't they supposed to
set an exception flag if x is less than 1?
-Alex
More information about the wine-devel
mailing list