Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Syntax for Math.pow() funtion in ATL
Syntax for Math.pow() funtion in ATL [message #482062] Tue, 25 August 2009 09:46 Go to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
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 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
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 #482740 is a reply to message #482143] Thu, 27 August 2009 17:57 Go to previous messageGo to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Thanks for your valuable input.


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 Go to previous messageGo to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
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 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
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
>
>
>
>
>
>
>
>
>
>
Re: [ATL] Re: Syntax for Math.pow() funtion in ATL [message #483840 is a reply to message #483620] Thu, 03 September 2009 10:16 Go to previous message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hello William,

I have given like this

from
v_left: LdmMetaModel!LDMAttribute
using{
---- syntax error

maxvalue: Real =exp(3*log(3))
}





but it's showing error.can u tell me how to represent this in an atl file.


thanks
venkatesh
Previous Topic:[QVTO] Integrating of QVT Editor in my RCP Application
Next Topic:[ATL] inconsistency in handling of enums in emfvm
Goto Forum:
  


Current Time: Wed Apr 24 19:00:17 GMT 2024

Powered by FUDForum. Page generated in 0.03718 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top