Date: Fri, 12 Apr 2019 14:58:22 -0700 From: Steve Kargl <sgk@troutmask.apl.washington.edu> To: Dima Pasechnik <dimpase+freebsd@gmail.com> Cc: FreeBSD Ports <freebsd-ports@freebsd.org> Subject: Re: Default python is 3.6? Message-ID: <20190412215822.GA84920@troutmask.apl.washington.edu> In-Reply-To: <CAAWYfq20j1vbjLfo0%2BQe4xF0C4PN14TrBgYB-JD3vddy%2Bquk-g@mail.gmail.com> References: <20190412161112.GA5963@troutmask.apl.washington.edu> <20190412161742.GA21349@troutmask.apl.washington.edu> <20190412162810.GA24821@troutmask.apl.washington.edu> <CAAWYfq1ptqRXJqGh12JD=E8LhEux4Rt_xY5P1Do6NMZJ5GTQ0A@mail.gmail.com> <20190412195655.GA59279@troutmask.apl.washington.edu> <CAAWYfq3B0ofvTQ=TvkCWYRzHi0=wwUeNrfZF3DtbxtBnk5gQFA@mail.gmail.com> <20190412202951.GA12942@troutmask.apl.washington.edu> <CAAWYfq20j1vbjLfo0%2BQe4xF0C4PN14TrBgYB-JD3vddy%2Bquk-g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 12, 2019 at 11:18:50PM +0200, Dima Pasechnik wrote: > > So there is more "software bureaucracy" here than just applying one patch. > % cd /usr/ports/lang % svn status A python27/files/patch-Modules___mathmodule.c A python35/files/patch-Modules___mathmodule.c A python36/files/patch-Modules___mathmodule.c % svn diff python27/files/patch-Modules___mathmodule.c \ python35/files/patch-Modules___mathmodule.c \ python36/files/patch-Modules___mathmodule.c > py.diff % cat py.diff Index: python27/files/patch-Modules___mathmodule.c =================================================================== --- python27/files/patch-Modules___mathmodule.c (nonexistent) +++ python27/files/patch-Modules___mathmodule.c (working copy) @@ -0,0 +1,38 @@ +--- ./Modules/mathmodule.c.orig 2019-04-12 10:00:28.518460000 -0700 ++++ ./Modules/mathmodule.c 2019-04-12 10:01:24.846412000 -0700 +@@ -71,7 +71,7 @@ + static const double sqrtpi = 1.772453850905516027298167483341145182798; + + static double +-sinpi(double x) ++_freebsd_ports_are_broken_sinpi(double x) + { + double y, r; + int n; +@@ -270,7 +270,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; +@@ -294,7 +294,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); +@@ -366,7 +366,7 @@ + (x-0.5)*(log(x+lanczos_g-0.5)-1); + } + else { +- r = log(pi) - log(fabs(sinpi(absx))) - log(absx) - ++ r = log(pi) - log(fabs(_freebsd_ports_are_broken_sinpi(absx))) - log(absx) - + (log(lanczos_sum(absx)) - lanczos_g + + (absx-0.5)*(log(absx+lanczos_g-0.5)-1)); + } Index: python35/files/patch-Modules___mathmodule.c =================================================================== --- python35/files/patch-Modules___mathmodule.c (nonexistent) +++ python35/files/patch-Modules___mathmodule.c (working copy) @@ -0,0 +1,38 @@ +--- ./Modules/mathmodule.c.orig 2019-04-12 14:35:01.873406000 -0700 ++++ ./Modules/mathmodule.c 2019-04-12 14:35:42.751667000 -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; Index: python36/files/patch-Modules___mathmodule.c =================================================================== --- python36/files/patch-Modules___mathmodule.c (nonexistent) +++ python36/files/patch-Modules___mathmodule.c (working copy) @@ -0,0 +1,38 @@ +--- ./Modules/mathmodule.c.orig 2019-04-12 09:23:42.329350000 -0700 ++++ ./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_port_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_port_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_port_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_port_are_broken_sinpi(absx))) - log(absx) - r; + if (Py_IS_INFINITY(r)) + errno = ERANGE; + return r; -- Steve
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190412215822.GA84920>