ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Is there a EXP function ????

Post new topic  Reply to topic
 Is there a EXP function ???? « View previous topic :: View next topic » 
Author Message
kiran26
PostPosted: Tue Dec 03, 2002 8:17 am    Post subject: Is there a EXP function ???? Reply with quote

Acolyte

Joined: 06 Feb 2002
Posts: 69

Hi all,
Is there a exponential function in the ESQL .If not how to work around it.

Thanks
kiran
Back to top
View user's profile Send private message
wmqiguy
PostPosted: Tue Dec 03, 2002 1:16 pm    Post subject: Reply with quote

Centurion

Joined: 09 Oct 2002
Posts: 145
Location: Florida

No EXP function that I know of, but I've been wrong before.

You could create your own function. Here is something I wrote from the top of my head and have not tested it. Everything is assumed to be an integer and it does not account for any exponents that are negative (or 0 or 1 for that matter.)

This could be handled very easily through some IF stuff. I'll leave that to if you need it.

The function call to calculate 2^4 would be:

SET myRESULT = calcEXP (2, 4);

And here is the function (I usually have this at the end of the ESQL.)

CREATE FUNCTION calcEXP (Base INTEGER, Exponent INTEGER)RETURNS INTEGER
BEGIN

DECLARE myCOUNT INTEGER;
SET myCOUNT = 2;
SET FinalAnswer = Base;

WHILE myCOUNT <= Exponent DO
FinalAnswer = FinalAnswer * Base;
SET myCOUNT = myCOUNT + 1;
END WHILE;

RETURN FinalAnswer;

END;

Probably more elegant methods, but hopefully this will give you something to start with.

Todd
Back to top
View user's profile Send private message
j.f.sorge
PostPosted: Thu Oct 16, 2008 3:13 am    Post subject: but you may use POWER(2, 4) Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

But you may use POWER(2, 4) in order to compute 2^4.
Back to top
View user's profile Send private message
mgk
PostPosted: Thu Oct 16, 2008 3:23 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
Is there a exponential function in the ESQL .If not how to work around it


Yes, it is called EXP and is documented in the help! Did you not bother to look or search before you posted or did you try to look and search but didn't find it?
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Is there a EXP function ????
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.