• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(4895)  |  Call(4340)  |  Derive(0)  |  Import(555)
log(x[, base])

Return the logarithm of x to the given base.
If the base not specified, returns the natural logarithm (base e) of x.

src/s/h/shedskin-HEAD/examples/mastermind2.py   shedskin(Download)
# Recipe 496907: Mastermind-style code-breaking, by Raymond Hettinger
# http://code.activestate.com/recipes/496907/
# Version speed up and adapted to Psyco D by leonardo maffi, V.1.0, Apr 4 2009
 
import random
from math import log
from collections import defaultdict
    s = float(len(possibles))
    for i in b.itervalues():
        p = i / s
        bits -= p * log(p, 2)
    return bits
 
def nodup(play):

src/l/e/Levmar-HEAD/examples/curvefit_psdvoigt.py   Levmar(Download)
and 3 for the lower and upper bound respectively, the third has only the
upper bound of 10, and the fourth has to be greater than or equal to 0.
"""
from math import (log, sqrt, pi,)
import numpy as np
import levmar
 
## If you prefer to reproduce the result, set a seed to the generator.
# np.random.seed(1234)
 
__4ln2 = 4 * log(2)

src/l/e/Levmar-HEAD/examples/curvefit_gauss.py   Levmar(Download)
and 3 for the lower and upper bound respectively, the third has only the
upper bound of 10, and the fourth has to be greater than or equal to 0.
"""
from math import (log, sqrt, pi,)
import numpy as np
import levmar
 
## If you prefer to reproduce the result, set a seed to the generator.
# np.random.seed(1234)
 
__4ln2 = 4 * log(2)

src/n/u/numeric-for-engineer-HEAD/example4_9.py   numeric-for-engineer(Download)
#!/usr/bin/python
## example4_9
from numarray import zeros,array
from math import sin,log
from newtonRaphson2 import *
 
def f(x):
    f = zeros((len(x)),type=Float64)
    f[0] = sin(x[0]) + x[1]**2 + log(x[2]) - 7.0

src/l/a/Langtangen-HEAD/src/py/examples/iterator.py   Langtangen(Download)
    print item
 
print 'generator for computing log(x) approximately:'
from math import log
def log_generator(a):
    u_old = 0.0; x = 1.0  # starting values
    while True:
        u_new = u_old + a/x
        x += a
        u_exact = log(x)

src/p/y/pyjamas-0.7/examples/libtest/RandomModuleTest.py   Pyjamas(Download)
from UnitTest import UnitTest
 
import random
from math import log, exp, sqrt, pi
try:
    from math import fsum as msum
except:

src/w/e/Werkzeug-0.6.2/examples/cupoftee/network.py   Werkzeug(Download)
"""
import time
import socket
from math import log
from datetime import datetime
from cupoftee.utils import unicodecmp
 
    def __init__(self, server, name, score):
        self.server = server
        self.name = name
        self.score = score
        self.size = round(100 + log(max(score, 1)) * 25, 2)
 

src/v/e/velocikit-HEAD/trunk/src/velocikit/examples/fractal/png.py   velocikit(Download)
#
 
from zlib import adler32, crc32
from math import log
 
class canvas:
 

src/v/e/velocikit-HEAD/trunk/src/velocikit/examples/fractal/fractal.py   velocikit(Download)
 
import StringIO
from math import log
from png import canvas 
 
class fractal_service(object):
 

src/v/e/velocikit-HEAD/src/velocikit/examples/fractal/png.py   velocikit(Download)
#
 
from zlib import adler32, crc32
from math import log
 
class canvas:
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next