[code.view]

[top] / python / PyMOTW / math / math_modf.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2010 Doug Hellmann.  All rights reserved.
     #
     """Split fractional from whole number part.
     """
     #end_pymotw_header
     
     import math
     
     for i in range(6):
         print '{}/2 = {}'.format(i, math.modf(i/2.0))
     

[top] / python / PyMOTW / math / math_modf.py

contact | logmethods.com