Default python is 3.6?

Steve Kargl sgk at troutmask.apl.washington.edu
Fri Apr 12 16:28:14 UTC 2019


On Fri, Apr 12, 2019 at 09:17:42AM -0700, Steve Kargl wrote:
> 
> % find . -name math\*
> ./work/Python-3.6.8/Doc/library/math.rst
> ./work/Python-3.6.8/Modules/mathmodule.c
> ./work/Python-3.6.8/Lib/test/math_testcases.txt
> ./work/stage/usr/local/lib/python3.6/test/math_testcases.txt
> 

Well, this one is easy to fix.  I've sent this patch for 2 to 3
years now.  I've opened a PR about it.  Someday you guys might
actually fix this, because I will contacting core to get my
commit bit back.



--- work/Python-3.6.8/Modules/mathmodule.c.orig	2019-04-12 09:23:42.329350000 -0700
+++ work/Python-3.6.8/Modules/mathmodule.c	2019-04-12 09:24:37.977029000 -0700
@@ -67,7 +67,7 @@
 static const double logpi = 1.144729885849400174143427351353058711647;
 
 static double
-sinpi(double x)
+_freebsd_ports_are_broken_sinpi(double x)
 {
     double y, r;
     int n;
@@ -296,7 +296,7 @@
        integer. */
     if (absx > 200.0) {
         if (x < 0.0) {
-            return 0.0/sinpi(x);
+            return 0.0/_freebsd_ports_are_broken_sinpi(x);
         }
         else {
             errno = ERANGE;
@@ -320,7 +320,7 @@
     }
     z = z * lanczos_g / y;
     if (x < 0.0) {
-        r = -pi / sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
+        r = -pi / _freebsd_ports_are_broken_sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
         r -= z * r;
         if (absx < 140.0) {
             r /= pow(y, absx - 0.5);
@@ -390,7 +390,7 @@
     r += (absx - 0.5) * (log(absx + lanczos_g - 0.5) - 1);
     if (x < 0.0)
         /* Use reflection formula to get value for negative x. */
-        r = logpi - log(fabs(sinpi(absx))) - log(absx) - r;
+        r = logpi - log(fabs(_freebsd_ports_are_broken_sinpi(absx))) - log(absx) - r;
     if (Py_IS_INFINITY(r))
         errno = ERANGE;
     return r;

-- 
Steve


More information about the freebsd-ports mailing list