在 2026-1-9 15:48, Markus Muetzel 写道:
+#if !defined(_USE_MATH_DEFINES)
+#define _USE_MATH_DEFINES
+#endif
+
+#include <math.h>

Does it make sense to just `#define _USE_MATH_DEFINES` without the `#if`? There's such a define in xaudio2.h but I think no other code in the CRT defines that.


+float __cdecl acospif(float x)
+{
+  return acosf(x)/M_PI;
+}

Becasuse `M_PI` is a `double`, this intermediate result is calculated as

   return (float) ((double) acosf(x) / M_PI);

When looking into this, I realize that the `long double` variants are probably not correct either. Despite having 21 significant figures, `(long double)(double) M_PI` might not yield the same value as `3.14159265358979323846L`. (When suffixed with `L`, this is accurate as a `long double`.) So maybe local definitions of PI are inevitable..?


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to