:-$

Ryan's work blog

My Links

News

The WeatherPixie
Subscribe with Bloglines
About this blog

Tools I use:

Post Categories

Article Categories

Archives

Image Galleries

Blog Stats

Personal

Projects

Random Blogs

Random other

Reference

Web comics

Work

More Python

I've been playing with Python some more, and got the equivalent code to Nathan's numerical deriver in lisp. Here's the code:
def cube(x):
    return x*x*x

def deriv(f):
    step = .0001
    return lambda x : (f(x+step) - f(x))/step
Then running it in the interpreter:
>>> deriv(cube)(10)
300.00300000892821
>>> deriv(deriv(cube))(10)
60.000616031175014
I'm currently making a stab at a tree generator. I like not having types all over the place.

posted on Sunday, August 15, 2004 6:17 PM