Home | History | Annotate | Download | only in test

Lines Matching defs:INF

14 INF = float('inf')
15 NINF = float('-inf')
70 # need to special case infinities, since inf - inf gives nan
151 self.assertRaises(ValueError, math.acos, INF)
161 self.assertEqual(math.acosh(INF), INF)
170 self.assertRaises(ValueError, math.asin, INF)
179 self.assertEqual(math.asinh(INF), INF)
188 self.ftest('atan(inf)', math.atan(INF), math.pi/2)
189 self.ftest('atan(-inf)', math.atan(NINF), -math.pi/2)
199 self.assertRaises(ValueError, math.atanh, INF)
212 self.ftest('atan2(0., -inf)', math.atan2(0., NINF), math.pi)
217 self.assertEqual(math.atan2(0., INF), 0.)
220 self.ftest('atan2(-0., -inf)', math.atan2(-0., NINF), -math.pi)
225 self.assertEqual(math.atan2(-0., INF), -0.)
227 # math.atan2(INF, x)
228 self.ftest('atan2(inf, -inf)', math.atan2(INF, NINF), math.pi*3/4)
229 self.ftest('atan2(inf, -2.3)', math.atan2(INF, -2.3), math.pi/2)
230 self.ftest('atan2(inf, -0.)', math.atan2(INF, -0.0), math.pi/2)
231 self.ftest('atan2(inf, 0.)', math.atan2(INF, 0.0), math.pi/2)
232 self.ftest('atan2(inf, 2.3)', math.atan2(INF, 2.3), math.pi/2)
233 self.ftest('atan2(inf, inf)', math.atan2(INF, INF), math.pi/4)
234 self.assertTrue(math.isnan(math.atan2(INF, NAN)))
236 self.ftest('atan2(-inf, -inf)', math.atan2(NINF, NINF), -math.pi*3/4)
237 self.ftest('atan2(-inf, -2.3)', math.atan2(NINF, -2.3), -math.pi/2)
238 self.ftest('atan2(-inf, -0.)', math.atan2(NINF, -0.0), -math.pi/2)
239 self.ftest('atan2(-inf, 0.)', math.atan2(NINF, 0.0), -math.pi/2)
240 self.ftest('atan2(-inf, 2.3)', math.atan2(NINF, 2.3), -math.pi/2)
241 self.ftest('atan2(-inf, inf)', math.atan2(NINF, INF), -math.pi/4)
244 self.ftest('atan2(2.3, -inf)', math.atan2(2.3, NINF), math.pi)
247 self.assertEqual(math.atan2(2.3, INF), 0.)
250 self.ftest('atan2(-2.3, -inf)', math.atan2(-2.3, NINF), -math.pi)
253 self.assertEqual(math.atan2(-2.3, INF), -0.)
261 self.assertTrue(math.isnan(math.atan2(NAN, INF)))
276 self.assertEqual(math.ceil(INF), INF)
305 self.assertEqual(math.copysign(INF, 0.), INF)
306 self.assertEqual(math.copysign(INF, -0.), NINF)
307 self.assertEqual(math.copysign(NINF, 0.), INF)
310 self.assertEqual(math.copysign(1., INF), 1.)
312 self.assertEqual(math.copysign(INF, INF), INF)
313 self.assertEqual(math.copysign(INF, NINF), NINF)
314 self.assertEqual(math.copysign(NINF, INF), INF)
317 self.assertTrue(math.isnan(math.copysign(NAN, INF)))
320 # copysign(INF, NAN) may be INF or it may be NINF, since
323 self.assertTrue(math.isinf(math.copysign(INF, NAN)))
334 self.assertTrue(math.isnan(math.cos(INF)))
337 self.assertRaises(ValueError, math.cos, INF)
345 self.assertEqual(math.cosh(INF), INF)
346 self.assertEqual(math.cosh(NINF), INF)
360 self.assertEqual(math.exp(INF), INF)
400 self.assertEqual(math.ceil(INF), INF)
429 self.assertRaises(ValueError, math.fmod, INF, 1.)
431 self.assertRaises(ValueError, math.fmod, INF, 0.)
432 self.assertEqual(math.fmod(3.0, INF), 3.0)
433 self.assertEqual(math.fmod(-3.0, INF), -3.0)
453 self.assertEqual(math.frexp(INF)[0], INF)
552 self.assertEqual(math.hypot(NAN, INF), INF)
553 self.assertEqual(math.hypot(INF, NAN), INF)
554 self.assertEqual(math.hypot(NAN, NINF), INF)
555 self.assertEqual(math.hypot(NINF, NAN), INF)
569 self.assertEqual(math.ldexp(INF, 30), INF)
575 self.assertEqual(math.ldexp(INF, -n), INF)
587 self.assertEqual(math.ldexp(INF, n), INF)
599 self.assertEqual(math.log(INF), INF)
609 self.assertEqual(math.log1p(INF), INF)
621 self.assertEqual(math.log(INF), INF)
637 self.assertEqual(math.modf(INF), (0.0, INF))
650 self.assertEqual(math.pow(INF, 1), INF)
652 self.assertEqual((math.pow(1, INF)), 1.)
660 self.assertEqual(math.pow(0., INF), 0.)
672 # pow(INF, x)
673 self.assertEqual(math.pow(INF, INF), INF)
674 self.assertEqual(math.pow(INF, 3.), INF)
675 self.assertEqual(math.pow(INF, 2.3), INF)
676 self.assertEqual(math.pow(INF, 2.), INF)
677 self.assertEqual(math.pow(INF, 0.), 1.)
678 self.assertEqual(math.pow(INF, -0.), 1.)
679 self.assertEqual(math.pow(INF, -2.), 0.)
680 self.assertEqual(math.pow(INF, -2.3), 0.)
681 self.assertEqual(math.pow(INF, -3.), 0.)
682 self.assertEqual(math.pow(INF, NINF), 0.)
683 self.assertTrue(math.isnan(math.pow(INF, NAN)))
686 self.assertEqual(math.pow(-0., INF), 0.)
699 self.assertEqual(math.pow(NINF, INF), INF)
701 self.assertEqual(math.pow(NINF, 2.3), INF)
702 self.assertEqual(math.pow(NINF, 2.), INF)
712 self.assertEqual(math.pow(-1., INF), 1.)
725 self.assertEqual(math.pow(1., INF), 1.)
752 self.assertEqual(math.pow(0.9, NINF), INF)
753 self.assertEqual(math.pow(0.1, NINF), INF)
754 self.assertEqual(math.pow(-0.1, NINF), INF)
755 self.assertEqual(math.pow(-0.9, NINF), INF)
759 # pow(x, INF)
760 self.assertEqual(math.pow(1.9, INF), INF)
761 self.assertEqual(math.pow(1.1, INF), INF)
762 self.assertEqual(math.pow(0.9, INF), 0.)
763 self.assertEqual(math.pow(0.1, INF), 0.)
764 self.assertEqual(math.pow(-0.1, INF), 0.)
765 self.assertEqual(math.pow(-0.9, INF), 0.)
766 self.assertEqual(math.pow(-1.1, INF), INF)
767 self.assertEqual(math.pow(-1.9, INF), INF)
785 #self.assertEqual(1**INF, 1)
789 #self.assertEqual(1.**INF, 1)
805 self.assertTrue(math.isnan(math.sin(INF)))
808 self.assertRaises(ValueError, math.sin, INF)
817 self.assertEqual(math.sinh(INF), INF)
826 self.assertEqual(math.sqrt(INF), INF)
836 self.assertTrue(math.isnan(math.tan(INF)))
839 self.assertRaises(ValueError, math.tan, INF)
847 self.ftest('tanh(inf)', math.tanh(INF), 1)
848 self.ftest('tanh(-inf)', math.tanh(NINF), -1)
884 self.assertTrue(math.isnan(float("inf")* 0.))
885 self.assertFalse(math.isnan(float("inf")))
890 self.assertTrue(math.isinf(float("inf")))
891 self.assertTrue(math.isinf(float("-inf")))
917 # is +Inf afterwards. But Python wants overflows detected by default.
927 # Inf (HUGE_VAL) to a NaN, and artificially setting errno to ERANGE