mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-44364:Add non integral tests for sqrt()
(#26625)
* Add non integral tests for `sqrt()` Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
This commit is contained in:
parent
31aa0dbff4
commit
90cd433032
2 changed files with 5 additions and 0 deletions
|
@ -1499,6 +1499,10 @@ class MathTests(unittest.TestCase):
|
|||
def testSqrt(self):
|
||||
self.assertRaises(TypeError, math.sqrt)
|
||||
self.ftest('sqrt(0)', math.sqrt(0), 0)
|
||||
self.ftest('sqrt(0)', math.sqrt(0.0), 0.0)
|
||||
self.ftest('sqrt(2.5)', math.sqrt(2.5), 1.5811388300841898)
|
||||
self.ftest('sqrt(0.25)', math.sqrt(0.25), 0.5)
|
||||
self.ftest('sqrt(25.25)', math.sqrt(25.25), 5.024937810560445)
|
||||
self.ftest('sqrt(1)', math.sqrt(1), 1)
|
||||
self.ftest('sqrt(4)', math.sqrt(4), 2)
|
||||
self.assertEqual(math.sqrt(INF), INF)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Add non integral tests for :func:`math.sqrt` function.
|
Loading…
Add table
Add a link
Reference in a new issue