Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. #
  4. # Copyright (c) 2010 Doug Hellmann. All rights reserved.
  5. #
  6. """Testing for not-a-number.
  7. """
  8. #end_pymotw_header
  9.  
  10. import math
  11.  
  12. x = (10.0 ** 200) * (10.0 ** 200)
  13. y = x/x
  14.  
  15. print 'x =', x
  16. print 'isnan(x) =', math.isnan(x)
  17. print 'y = x / x =', x/x
  18. print 'y == nan =', y == float('nan')
  19. print 'isnan(y) =', math.isnan(y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement