Skip to content

Commit 90cd433

Browse files
ajthrmdickinson
andauthored
bpo-44364:Add non integral tests for sqrt() (#26625)
* Add non integral tests for `sqrt()` Co-authored-by: Mark Dickinson <[email protected]>
1 parent 31aa0db commit 90cd433

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Lib/test/test_math.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,10 @@ def testSinh(self):
14991499
def testSqrt(self):
15001500
self.assertRaises(TypeError, math.sqrt)
15011501
self.ftest('sqrt(0)', math.sqrt(0), 0)
1502+
self.ftest('sqrt(0)', math.sqrt(0.0), 0.0)
1503+
self.ftest('sqrt(2.5)', math.sqrt(2.5), 1.5811388300841898)
1504+
self.ftest('sqrt(0.25)', math.sqrt(0.25), 0.5)
1505+
self.ftest('sqrt(25.25)', math.sqrt(25.25), 5.024937810560445)
15021506
self.ftest('sqrt(1)', math.sqrt(1), 1)
15031507
self.ftest('sqrt(4)', math.sqrt(4), 2)
15041508
self.assertEqual(math.sqrt(INF), INF)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add non integral tests for :func:`math.sqrt` function.

0 commit comments

Comments
 (0)