Raised This Month: $ Target: $400
 0% 

[help] making a function in pawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tmp2
Junior Member
Join Date: Jan 2006
Old 09-29-2012 , 14:48   [help] making a function in pawn
Reply With Quote #1

Hey all mates, i am trying to find a way to copy a function i've got in excel to pawn.

The function is GAMMADIST
http://office.microsoft.com/en-us/ex...005209101.aspx

anyone has any idea how to use/make this function properly in pawn?
its very important and any help will be appreciated.

Best regards, tmp2.
tmp2 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-29-2012 , 15:41   Re: [help] making a function in pawn
Reply With Quote #2

I'm not sure how hard this would be. You would need to find out how the gammadist function works and implement that.
__________________

Last edited by fysiks; 09-29-2012 at 15:44.
fysiks is offline
tmp2
Junior Member
Join Date: Jan 2006
Old 09-29-2012 , 18:17   Re: [help] making a function in pawn
Reply With Quote #3

yea that is obvious , but the thing is , i am having problems trying to implement that.

the function is:


now how do i get this into pawn?
tmp2 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-29-2012 , 21:10   Re: [help] making a function in pawn
Reply With Quote #4

What problems are you having?
__________________
fysiks is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-29-2012 , 23:18   Re: [help] making a function in pawn
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
What problems are you having?
Probably on how to implement that one symbol in the denominator to the left or (alpha). I think that's another function within itself or something, not completely sure.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please

Last edited by nikhilgupta345; 09-29-2012 at 23:18.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-29-2012 , 23:25   Re: [help] making a function in pawn
Reply With Quote #6

Quote:
Originally Posted by nikhilgupta345 View Post
Probably on how to implement that one symbol in the denominator to the left or (alpha). I think that's another function within itself or something, not completely sure.
That is capital Gamma. According to wikipedia, it's actually a simple function.
__________________
fysiks is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 09-29-2012 , 23:28   Re: [help] making a function in pawn
Reply With Quote #7

Quote:
Originally Posted by nikhilgupta345 View Post
Probably on how to implement that one symbol in the denominator to the left or (alpha). I think that's another function within itself or something, not completely sure.
Besides that detail, the function would be:

PHP Code:
gammadist(xabeta)
{
    static const 
e_value 2.72
    
return (1/power(betaa) * themiscoperator a) * power(xa-1) * power(e_value, -(x/beta))

EDIT:

Quote:
Originally Posted by fysiks View Post
That is capital Gamma. According to wikipedia, it's actually a simple function.
It's equal to (n - 1)!, any way for expressing the ! operator?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross

Last edited by meTaLiCroSS; 09-29-2012 at 23:32.
meTaLiCroSS is offline
Old 09-29-2012, 23:32
meTaLiCroSS
This message has been deleted by meTaLiCroSS. Reason: wtf
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-29-2012 , 23:43   Re: [help] making a function in pawn
Reply With Quote #8

Quote:
Originally Posted by meTaLiCroSS View Post
Besides that detail, the function would be:

PHP Code:
gammadist(xabeta)
{
    static const 
e_value 2.72
    
return (1/power(betaa) * themiscoperator a) * power(xa-1) * power(e_value, -(x/beta))

EDIT:



It's equal to (n - 1)!, any way for expressing the ! operator?
The easiest way to do factorials would probably be just to make a simple recursive function.

PHP Code:
public factorial(int n)
{
    if(
== 1)
        return 
1;
        
    return 
factorial(1);

__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode