[code.view]

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

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2010 Doug Hellmann.  All rights reserved.
     #
     """Natural logarithm of Gamma
     """
     #end_pymotw_header
     
     import math
     
     for i in [ 0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6 ]:
         try:
             print '{:2.1f}  {:.20f}  {:.20f}'.format(i, math.lgamma(i), math.log(math.gamma(i)))
         except ValueError, err:
             print 'Error computing lgamma(%s):' % i, err
     
     

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

contact | logmethods.com