Advertisement
rfmonk

math_isinf.py

Jan 23rd, 2014
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. import math
  2.  
  3. print '{:^3} {:6} {:6} {:6}'.format('e', 'x', 'x**2', 'isinf')
  4. print '{:-^3} {:-^6} {:-^6} {:-^6}'.format('', '', '', '')
  5.  
  6. for e in range(0, 201, 20):
  7.     x = 10.0 ** e
  8.     y = x * x
  9.     print '{:3d} {!s:6} {!s:6} {!s:6}'.format(e, x, y, math.isinf(y),)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement