summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_math.py
diff options
context:
space:
mode:
authorAjith Ramachandran <ajithar204@gmail.com>2021-06-10 16:27:26 (GMT)
committerGitHub <noreply@github.com>2021-06-10 16:27:26 (GMT)
commit90cd4330329a99e52f7141db5e0a469d30088e66 (patch)
treedfd5fa803cb78b742e4b3aa70e5efb64441a118a /Lib/test/test_math.py
parent31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b (diff)
downloadcpython-90cd4330329a99e52f7141db5e0a469d30088e66.zip
cpython-90cd4330329a99e52f7141db5e0a469d30088e66.tar.gz
cpython-90cd4330329a99e52f7141db5e0a469d30088e66.tar.bz2
bpo-44364:Add non integral tests for `sqrt()` (#26625)
* Add non integral tests for `sqrt()` Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Diffstat (limited to 'Lib/test/test_math.py')
-rw-r--r--Lib/test/test_math.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index 3d12874..9eb455a 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -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)