Skip to content

Commit 925235f

Browse files
committed
Remove default values from the test support functions
1 parent 43a7ba9 commit 925235f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_math.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,7 @@ def linspace(lo, hi, n):
14001400
width = (hi - lo) / (n - 1)
14011401
return [lo + width * i for i in range(n)]
14021402

1403-
def GenDot(n, c=1e12):
1403+
def GenDot(n, c):
14041404
""" Algorithm 6.1 (GenDot) works as follows. The condition number (5.7) of
14051405
the dot product xT y is proportional to the degree of cancellation. In
14061406
order to achieve a prescribed cancellation, we generate the first half of
@@ -1443,7 +1443,7 @@ def RelativeError(res, ex):
14431443
n = DotExact(list(x) + [-res], list(y) + [1])
14441444
return fabs(n / target_sumprod)
14451445

1446-
def Trial(dotfunc, c=10e7, n=10):
1446+
def Trial(dotfunc, c, n):
14471447
ex = GenDot(10, c)
14481448
res = dotfunc(ex.x, ex.y)
14491449
return RelativeError(res, ex)
@@ -1452,7 +1452,7 @@ def Trial(dotfunc, c=10e7, n=10):
14521452
n = 20 # Length of vectors
14531453
c = 1e30 # Target condition number
14541454

1455-
relative_err = median(Trial(sumprod, c=c, n=n) for i in range(times))
1455+
relative_err = median(Trial(sumprod, c, n) for i in range(times))
14561456
self.assertLess(relative_err, 1e-16)
14571457

14581458
def testModf(self):

0 commit comments

Comments
 (0)