aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Python/pymath.c
diff options
context:
space:
mode:
authormonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
committermonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
commit06e5c21a835c0e923506c4ff27929f34e00761c2 (patch)
tree75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /contrib/tools/python3/src/Python/pymath.c
parent03f024c4412e3aa613bb543cf1660176320ba8f4 (diff)
downloadydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz
fix ya.make
Diffstat (limited to 'contrib/tools/python3/src/Python/pymath.c')
-rw-r--r--contrib/tools/python3/src/Python/pymath.c81
1 files changed, 0 insertions, 81 deletions
diff --git a/contrib/tools/python3/src/Python/pymath.c b/contrib/tools/python3/src/Python/pymath.c
deleted file mode 100644
index 24b804223e..0000000000
--- a/contrib/tools/python3/src/Python/pymath.c
+++ /dev/null
@@ -1,81 +0,0 @@
-#include "Python.h"
-
-#ifdef X87_DOUBLE_ROUNDING
-/* On x86 platforms using an x87 FPU, this function is called from the
- Py_FORCE_DOUBLE macro (defined in pymath.h) to force a floating-point
- number out of an 80-bit x87 FPU register and into a 64-bit memory location,
- thus rounding from extended precision to double precision. */
-double _Py_force_double(double x)
-{
- volatile double y;
- y = x;
- return y;
-}
-#endif
-
-#ifdef HAVE_GCC_ASM_FOR_X87
-
-/* inline assembly for getting and setting the 387 FPU control word on
- gcc/x86 */
-#ifdef _Py_MEMORY_SANITIZER
-__attribute__((no_sanitize_memory))
-#endif
-unsigned short _Py_get_387controlword(void) {
- unsigned short cw;
- __asm__ __volatile__ ("fnstcw %0" : "=m" (cw));
- return cw;
-}
-
-void _Py_set_387controlword(unsigned short cw) {
- __asm__ __volatile__ ("fldcw %0" : : "m" (cw));
-}
-
-#endif
-
-
-#ifndef HAVE_HYPOT
-double hypot(double x, double y)
-{
- double yx;
-
- x = fabs(x);
- y = fabs(y);
- if (x < y) {
- double temp = x;
- x = y;
- y = temp;
- }
- if (x == 0.)
- return 0.;
- else {
- yx = y/x;
- return x*sqrt(1.+yx*yx);
- }
-}
-#endif /* HAVE_HYPOT */
-
-#ifndef HAVE_COPYSIGN
-double
-copysign(double x, double y)
-{
- /* use atan2 to distinguish -0. from 0. */
- if (y > 0. || (y == 0. && atan2(y, -1.) > 0.)) {
- return fabs(x);
- } else {
- return -fabs(x);
- }
-}
-#endif /* HAVE_COPYSIGN */
-
-#ifndef HAVE_ROUND
-double
-round(double x)
-{
- double absx, y;
- absx = fabs(x);
- y = floor(absx);
- if (absx - y >= 0.5)
- y += 1.0;
- return copysign(y, x);
-}
-#endif /* HAVE_ROUND */