Syntax for Math.pow() funtion in ATL [message #482062] |
Tue, 25 August 2009 09:46  |
Eclipse User |
|
|
|
Hi,
I wanted to some mathematical calculation in ATL.
The following code is written in java
double maxDouble = Math.pow(2, 223*8) - 1;
long maxUIntValue = Math.min((long)maxDouble, Long.MAX_VALUE);
I wanted to do same thing in ATL but i don't know how these pow() & min()
functions are defined in ATL.
Thanks
venkatesh
|
|
|
[ATL] Re: Syntax for Math.pow() funtion in ATL [message #482143 is a reply to message #482062] |
Tue, 25 August 2009 13:10   |
Eclipse User |
|
|
|
Hello,
There is no pow() function in ATL, but you can do it using exp() and
log() functions, which are available in ATL, as the min() function.
Here is the list of the numerical functions in ATL:
http://wiki.eclipse.org/ATL/User_Guide#Numerical_data_type_o perations
Best regards,
William
venkatesh a écrit :
> Hi,
>
> I wanted to some mathematical calculation in ATL.
>
> The following code is written in java
>
> double maxDouble = Math.pow(2, 223*8) - 1;
> long maxUIntValue = Math.min((long)maxDouble, Long.MAX_VALUE);
>
>
> I wanted to do same thing in ATL but i don't know how these pow() &
> min() functions are defined in ATL.
>
>
> Thanks
> venkatesh
>
|
|
|
|
Re: [ATL] Re: Syntax for Math.pow() funtion in ATL [message #483587 is a reply to message #482143] |
Wed, 02 September 2009 09:01   |
Eclipse User |
|
|
|
Hello William ,
I have tried using exp () and log funtion instead of power and min math
funtion in java
if i give let var :Integer= 2.exp()
it's working fine
but i want 2 raise to the power 8 (2^8) how to represent
this in a exp()
there is no example to use this exp() & log() function .
can u please give me some example.
Thanks
venkatesh
|
|
|
Re: [ATL] Re: Syntax for Math.pow() funtion in ATL [message #483620 is a reply to message #483587] |
Wed, 02 September 2009 11:15   |
Eclipse User |
|
|
|
Hello,
This page http://en.wikipedia.org/wiki/Exponentiation#Real_powers
indicates that you can compute pow with exp and log functions:
b^x = exp(x*log(b))
Best regards,
William
venkatesh a écrit :
> Hello William ,
>
> I have tried using exp () and log funtion instead of power and min math
> funtion in java
>
> if i give let var :Integer= 2.exp() it's working fine
>
> but i want 2 raise to the power 8 (2^8) how to represent this in a exp()
>
> there is no example to use this exp() & log() function .
>
> can u please give me some example.
>
> Thanks
>
> venkatesh
>
>
>
>
>
>
>
>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.23941 seconds