• Home
  • Raw
  • Download

Lines Matching refs:pow_op

291         for pow_op in pow, operator.pow:
293 self.assertTrue(isnan(pow_op(-INF, NAN)))
294 self.assertTrue(isnan(pow_op(-2.0, NAN)))
295 self.assertTrue(isnan(pow_op(-1.0, NAN)))
296 self.assertTrue(isnan(pow_op(-0.5, NAN)))
297 self.assertTrue(isnan(pow_op(-0.0, NAN)))
298 self.assertTrue(isnan(pow_op(0.0, NAN)))
299 self.assertTrue(isnan(pow_op(0.5, NAN)))
300 self.assertTrue(isnan(pow_op(2.0, NAN)))
301 self.assertTrue(isnan(pow_op(INF, NAN)))
302 self.assertTrue(isnan(pow_op(NAN, NAN)))
305 self.assertTrue(isnan(pow_op(NAN, -INF)))
306 self.assertTrue(isnan(pow_op(NAN, -2.0)))
307 self.assertTrue(isnan(pow_op(NAN, -1.0)))
308 self.assertTrue(isnan(pow_op(NAN, -0.5)))
309 self.assertTrue(isnan(pow_op(NAN, 0.5)))
310 self.assertTrue(isnan(pow_op(NAN, 1.0)))
311 self.assertTrue(isnan(pow_op(NAN, 2.0)))
312 self.assertTrue(isnan(pow_op(NAN, INF)))
315 self.assertRaises(ZeroDivisionError, pow_op, -0.0, -1.0)
316 self.assertRaises(ZeroDivisionError, pow_op, 0.0, -1.0)
320 self.assertRaises(ZeroDivisionError, pow_op, -0.0, -2.0)
321 self.assertRaises(ZeroDivisionError, pow_op, -0.0, -0.5)
322 self.assertRaises(ZeroDivisionError, pow_op, 0.0, -2.0)
323 self.assertRaises(ZeroDivisionError, pow_op, 0.0, -0.5)
326 self.assertEqualAndEqualSign(pow_op(-0.0, 1.0), -0.0)
327 self.assertEqualAndEqualSign(pow_op(0.0, 1.0), 0.0)
330 self.assertEqualAndEqualSign(pow_op(-0.0, 0.5), 0.0)
331 self.assertEqualAndEqualSign(pow_op(-0.0, 2.0), 0.0)
332 self.assertEqualAndEqualSign(pow_op(0.0, 0.5), 0.0)
333 self.assertEqualAndEqualSign(pow_op(0.0, 2.0), 0.0)
336 self.assertEqualAndEqualSign(pow_op(-1.0, -INF), 1.0)
337 self.assertEqualAndEqualSign(pow_op(-1.0, INF), 1.0)
340 self.assertEqualAndEqualSign(pow_op(1.0, -INF), 1.0)
341 self.assertEqualAndEqualSign(pow_op(1.0, -2.0), 1.0)
342 self.assertEqualAndEqualSign(pow_op(1.0, -1.0), 1.0)
343 self.assertEqualAndEqualSign(pow_op(1.0, -0.5), 1.0)
344 self.assertEqualAndEqualSign(pow_op(1.0, -0.0), 1.0)
345 self.assertEqualAndEqualSign(pow_op(1.0, 0.0), 1.0)
346 self.assertEqualAndEqualSign(pow_op(1.0, 0.5), 1.0)
347 self.assertEqualAndEqualSign(pow_op(1.0, 1.0), 1.0)
348 self.assertEqualAndEqualSign(pow_op(1.0, 2.0), 1.0)
349 self.assertEqualAndEqualSign(pow_op(1.0, INF), 1.0)
350 self.assertEqualAndEqualSign(pow_op(1.0, NAN), 1.0)
353 self.assertEqualAndEqualSign(pow_op(-INF, 0.0), 1.0)
354 self.assertEqualAndEqualSign(pow_op(-2.0, 0.0), 1.0)
355 self.assertEqualAndEqualSign(pow_op(-1.0, 0.0), 1.0)
356 self.assertEqualAndEqualSign(pow_op(-0.5, 0.0), 1.0)
357 self.assertEqualAndEqualSign(pow_op(-0.0, 0.0), 1.0)
358 self.assertEqualAndEqualSign(pow_op(0.0, 0.0), 1.0)
359 self.assertEqualAndEqualSign(pow_op(0.5, 0.0), 1.0)
360 self.assertEqualAndEqualSign(pow_op(1.0, 0.0), 1.0)
361 self.assertEqualAndEqualSign(pow_op(2.0, 0.0), 1.0)
362 self.assertEqualAndEqualSign(pow_op(INF, 0.0), 1.0)
363 self.assertEqualAndEqualSign(pow_op(NAN, 0.0), 1.0)
364 self.assertEqualAndEqualSign(pow_op(-INF, -0.0), 1.0)
365 self.assertEqualAndEqualSign(pow_op(-2.0, -0.0), 1.0)
366 self.assertEqualAndEqualSign(pow_op(-1.0, -0.0), 1.0)
367 self.assertEqualAndEqualSign(pow_op(-0.5, -0.0), 1.0)
368 self.assertEqualAndEqualSign(pow_op(-0.0, -0.0), 1.0)
369 self.assertEqualAndEqualSign(pow_op(0.0, -0.0), 1.0)
370 self.assertEqualAndEqualSign(pow_op(0.5, -0.0), 1.0)
371 self.assertEqualAndEqualSign(pow_op(1.0, -0.0), 1.0)
372 self.assertEqualAndEqualSign(pow_op(2.0, -0.0), 1.0)
373 self.assertEqualAndEqualSign(pow_op(INF, -0.0), 1.0)
374 self.assertEqualAndEqualSign(pow_op(NAN, -0.0), 1.0)
377 self.assertRaises(ValueError, pow_op, -2.0, -0.5)
378 self.assertRaises(ValueError, pow_op, -2.0, 0.5)
379 self.assertRaises(ValueError, pow_op, -1.0, -0.5)
380 self.assertRaises(ValueError, pow_op, -1.0, 0.5)
381 self.assertRaises(ValueError, pow_op, -0.5, -0.5)
382 self.assertRaises(ValueError, pow_op, -0.5, 0.5)
385 self.assertEqualAndEqualSign(pow_op(-0.5, -INF), INF)
386 self.assertEqualAndEqualSign(pow_op(-0.0, -INF), INF)
387 self.assertEqualAndEqualSign(pow_op(0.0, -INF), INF)
388 self.assertEqualAndEqualSign(pow_op(0.5, -INF), INF)
391 self.assertEqualAndEqualSign(pow_op(-INF, -INF), 0.0)
392 self.assertEqualAndEqualSign(pow_op(-2.0, -INF), 0.0)
393 self.assertEqualAndEqualSign(pow_op(2.0, -INF), 0.0)
394 self.assertEqualAndEqualSign(pow_op(INF, -INF), 0.0)
397 self.assertEqualAndEqualSign(pow_op(-0.5, INF), 0.0)
398 self.assertEqualAndEqualSign(pow_op(-0.0, INF), 0.0)
399 self.assertEqualAndEqualSign(pow_op(0.0, INF), 0.0)
400 self.assertEqualAndEqualSign(pow_op(0.5, INF), 0.0)
403 self.assertEqualAndEqualSign(pow_op(-INF, INF), INF)
404 self.assertEqualAndEqualSign(pow_op(-2.0, INF), INF)
405 self.assertEqualAndEqualSign(pow_op(2.0, INF), INF)
406 self.assertEqualAndEqualSign(pow_op(INF, INF), INF)
409 self.assertEqualAndEqualSign(pow_op(-INF, -1.0), -0.0)
412 self.assertEqualAndEqualSign(pow_op(-INF, -0.5), 0.0)
413 self.assertEqualAndEqualSign(pow_op(-INF, -2.0), 0.0)
416 self.assertEqualAndEqualSign(pow_op(-INF, 1.0), -INF)
419 self.assertEqualAndEqualSign(pow_op(-INF, 0.5), INF)
420 self.assertEqualAndEqualSign(pow_op(-INF, 2.0), INF)
423 self.assertEqualAndEqualSign(pow_op(INF, 0.5), INF)
424 self.assertEqualAndEqualSign(pow_op(INF, 1.0), INF)
425 self.assertEqualAndEqualSign(pow_op(INF, 2.0), INF)
428 self.assertEqualAndEqualSign(pow_op(INF, -2.0), 0.0)
429 self.assertEqualAndEqualSign(pow_op(INF, -1.0), 0.0)
430 self.assertEqualAndEqualSign(pow_op(INF, -0.5), 0.0)
433 self.assertEqualAndEqualSign(pow_op(-2.0, -2.0), 0.25)
434 self.assertEqualAndEqualSign(pow_op(-2.0, -1.0), -0.5)
435 self.assertEqualAndEqualSign(pow_op(-2.0, -0.0), 1.0)
436 self.assertEqualAndEqualSign(pow_op(-2.0, 0.0), 1.0)
437 self.assertEqualAndEqualSign(pow_op(-2.0, 1.0), -2.0)
438 self.assertEqualAndEqualSign(pow_op(-2.0, 2.0), 4.0)
439 self.assertEqualAndEqualSign(pow_op(-1.0, -2.0), 1.0)
440 self.assertEqualAndEqualSign(pow_op(-1.0, -1.0), -1.0)
441 self.assertEqualAndEqualSign(pow_op(-1.0, -0.0), 1.0)
442 self.assertEqualAndEqualSign(pow_op(-1.0, 0.0), 1.0)
443 self.assertEqualAndEqualSign(pow_op(-1.0, 1.0), -1.0)
444 self.assertEqualAndEqualSign(pow_op(-1.0, 2.0), 1.0)
445 self.assertEqualAndEqualSign(pow_op(2.0, -2.0), 0.25)
446 self.assertEqualAndEqualSign(pow_op(2.0, -1.0), 0.5)
447 self.assertEqualAndEqualSign(pow_op(2.0, -0.0), 1.0)
448 self.assertEqualAndEqualSign(pow_op(2.0, 0.0), 1.0)
449 self.assertEqualAndEqualSign(pow_op(2.0, 1.0), 2.0)
450 self.assertEqualAndEqualSign(pow_op(2.0, 2.0), 4.0)
454 self.assertEqualAndEqualSign(pow_op(1.0, -1e100), 1.0)
455 self.assertEqualAndEqualSign(pow_op(1.0, 1e100), 1.0)
456 self.assertEqualAndEqualSign(pow_op(-1.0, -1e100), 1.0)
457 self.assertEqualAndEqualSign(pow_op(-1.0, 1e100), 1.0)
460 self.assertEqualAndEqualSign(pow_op(-2.0, -2000.0), 0.0)
461 self.assertRaises(ValueError, pow_op, -2.0, -2000.5)
462 self.assertEqualAndEqualSign(pow_op(-2.0, -2001.0), -0.0)
463 self.assertEqualAndEqualSign(pow_op(2.0, -2000.0), 0.0)
464 self.assertEqualAndEqualSign(pow_op(2.0, -2000.5), 0.0)
465 self.assertEqualAndEqualSign(pow_op(2.0, -2001.0), 0.0)
466 self.assertEqualAndEqualSign(pow_op(-0.5, 2000.0), 0.0)
467 self.assertRaises(ValueError, pow_op, -0.5, 2000.5)
468 self.assertEqualAndEqualSign(pow_op(-0.5, 2001.0), -0.0)
469 self.assertEqualAndEqualSign(pow_op(0.5, 2000.0), 0.0)
470 self.assertEqualAndEqualSign(pow_op(0.5, 2000.5), 0.0)
471 self.assertEqualAndEqualSign(pow_op(0.5, 2001.0), 0.0)