Re: UCALC equivalent

2005-08-13 Thread Scott David Daniels
John Machin wrote: > Scott David Daniels wrote: >> max wrote: >>> Larry Bates <[EMAIL PROTECTED]> wrote in >> The python equivalent: >> ... >> exec "def shl(x, y): return x * 2^y" > > Perhaps this should be: > exec "def shl(x, y): return x * 2 ** y" > or > exec "def shl(x, y): return x <<

Re: UCALC equivalent

2005-08-12 Thread John Machin
Scott David Daniels wrote: > max wrote: > >> Larry Bates <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >> >>> Python has built in eval function and doesn't require a library. >> >> >> Are you kidding? Read the original post a little more closely. The >> o.p. is looking for a library tha

Re: UCALC equivalent

2005-08-12 Thread William Park
Dark Cowherd <[EMAIL PROTECTED]> wrote: > http://www.ucalc.com/mathparser/index.html > > There is a great library called UCALC which allows you to set up an > expression and evaluate it > for e.g. you an define an expression by calling a function in UCALC > then call it with various values of x >

Re: UCALC equivalent

2005-08-12 Thread Dark Cowherd
thx, Well moving to Python from another language needs lots of chanegs inside your head. -- DarkCowherd -- http://mail.python.org/mailman/listinfo/python-list

Re: UCALC equivalent

2005-08-12 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Max Erickson <[EMAIL PROTECTED]> wrote: . . . >> The python equivalent: >> >> exec "def area(length,width): return length*width" >> exec "def frac(x): return abs(abs(x) - int(abs(x)))

Re: UCALC equivalent

2005-08-12 Thread Scott David Daniels
Max Erickson wrote: > Scott David Daniels <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > >>max wrote: >> From the web page referenced: >> ... >> cout << ucEval("abc(5)-abc(3,4)*(#b01101 shl 1)") >> << endl; >>The python equivalent: >> ... >> print eval("abc(5

Re: UCALC equivalent

2005-08-12 Thread Max Erickson
Scott David Daniels <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > max wrote: >> Larry Bates <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >>>Python has built in eval function and doesn't require a library. >> >> Are you kidding? Read the original post a little more closely. >

Re: UCALC equivalent

2005-08-12 Thread Scott David Daniels
max wrote: > Larry Bates <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: >>Python has built in eval function and doesn't require a library. > > Are you kidding? Read the original post a little more closely. The > o.p. is looking for a library that evaluates mathematical expressions > and

Re: UCALC equivalent

2005-08-12 Thread max
Larry Bates <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Python has built in eval function and doesn't require > a library. > > Larry Bates > Are you kidding? Read the original post a little more closely. The o.p. is looking for a library that evaluates mathematical expressions and

Re: UCALC equivalent

2005-08-12 Thread Larry Bates
Python has built in eval function and doesn't require a library. Larry Bates Dark Cowherd wrote: > http://www.ucalc.com/mathparser/index.html > > There is a great library called UCALC which allows you to set up an > expression and evaluate it > for e.g. you an define an expression by calling a f