File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1974,6 +1974,11 @@ def testIsfinite(self):
19741974 self .assertFalse (math .isfinite (float ("-inf" )))
19751975
19761976 def testIsnormal (self ):
1977+ # C11, §7.12.3.5 requires isnormal() to return
1978+ # a nonzero value if and only its argument has
1979+ # a normal value.
1980+ self .assertIsInstance (math .isnormal (1.0 ), bool )
1981+
19771982 self .assertTrue (math .isnormal (1.25 ))
19781983 self .assertTrue (math .isnormal (- 1.0 ))
19791984 self .assertFalse (math .isnormal (0.0 ))
@@ -1985,6 +1990,11 @@ def testIsnormal(self):
19851990 self .assertFalse (math .isnormal (- FLOAT_MIN / 2 ))
19861991
19871992 def testIssubnormal (self ):
1993+ # issubnormal() is a C extension (ISO/IEC TS 18661-1:2014)
1994+ # and part of the C23 standard. In particular, it follows
1995+ # the same convention as isnormal() for its return value.
1996+ self .assertIsInstance (math .issubnormal (FLOAT_MIN / 2 ), bool )
1997+
19881998 self .assertFalse (math .issubnormal (1.25 ))
19891999 self .assertFalse (math .issubnormal (- 1.0 ))
19902000 self .assertFalse (math .issubnormal (0.0 ))
You can’t perform that action at this time.
0 commit comments