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 <<
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
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
>
thx,
Well moving to Python from another language needs lots of chanegs
inside your head.
--
DarkCowherd
--
http://mail.python.org/mailman/listinfo/python-list
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)))
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
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.
>
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
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
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
10 matches
Mail list logo