Yep, Token.pow() takes an integer exponent.

However, I _think you can get access to Math.pow(double,double) in
the Expression Evaluator console:

>> pow(3.0,2.0)
9.0
>> pow(3.0,2.1)
10.0451085663051
>> pow(0.5,0.5)
0.7071067811865
>> pow(0.5,-0.5)
1.4142135623731
>> pow(-0.5,-0.5)
NaN

Note that ^ means integer power:
>> 2^2
4
>> 2^0.5
Exponent must have a valid lossless conversion to integer. Integer or
unsigned byte meet this criterion.
Use pow(10, 3.5) for non-integer exponents
>> 

_Christopher

--------
    
    Hi all,
    
    I was trying to use the expression evaluator to calculate a double =
    precision exponent, but realized that the pow method of the Token class =
    translates the power function to a multiplication of the first argument =
    by itself number of times as specified by the second (exponent) =
    argument, and thus it is not supported for double precision exponents.
    
    Is there another way to use the ParseTreeEvaluator to evaluate =
    expressions that would allow this, or are there any plans to support it =
    in the future?
    
    Thanks a lot,
    Efrat

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to