SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Thread Tools Display Modes
Old 29/08/2017, 05:29 PM   #1
Big Clucker
Jelly23's Avatar
Join Date: Aug 2017
Posts: 102
Reputation: 202
Default CMath Library

• CMath Library

I released this plugin well before in Portuguese section before my account removal but didn't do it here until now, this was pretty much my first plugin release back then.

This plugin allows you to use some of CMath library's mathematical functions, few aren't included since they already exist.

Reference: Here

native Float:cosh(Float:x);
native Float:sinh(Float:x);
native Float:tanh(Float:x);
native Float:acosh(Float:x);
native Float:asinh(Float:x);
native Float:atanh(Float:x);
native Float:exp(Float:x);
native Float:frexp(Float:x, &exp);
native Float:ldexp(Float:x, exp);
native Float:log10(Float:x);
native Float:modf(Float:x, &Float:intpart);
native Float:exp2(Float:x);
native Float:expm1(Float:x);
native ilogb(Float:x);
native Float:log1p(Float:x);
native Float:log2(Float:x);
native Float:logb(Float:x);
native Float:scalbn(Float:x, exp);
native Float:cbrt(Float:x);
native Float:hypot(Float:x, Float:y);
native Float:tgamma(Float:x);
native Float:lgamma(Float:x);
native Float:remquo(Float:numer, Float:denom, &quot);
native Float:copysign(Float:x, Float:y);
native Float:fdim(Float:x, Float:y);
native Float:fmax(Float:x, Float:y);
native Float:fmin(Float:x, Float:y);
PHP Code:
//Example: native Float:frexp(Float:x, &exp); 


Float:param 8.0Float:resultn

result frexp (param n); 
printf ("%f = %f * 2^%d\n"paramresultn); 

//Output: 8.000000 = 0.500000 * 2^4 
PHP Code:
//Example: native Float:remquo(Float:numer, Float:denom, &quot); 


Floatnumer 10.3Float:denom 4.5Float:resultquot
result remquo (numerdenomquot); 
printf ("numerator: %f"numer); 
printf ("denominator: %f"denom); 
printf ("remainder: %f"result); 
printf ("quotient: %d"quot); 



numerator: 10.300000 
denominator: 4.500000 
remainder: 1.300000 
quotient: 2 

-Thanks to Dayvison_ for linux binary.


Jelly23 is offline   Reply With Quote
Old 30/08/2017, 04:49 PM   #2
C4rtm4n's Avatar
Join Date: Jul 2017
Location: South Park
Posts: 698
Reputation: 15
Default Re: CMath Library

Good Plugin
No Projects At the moment

C4rtm4n is offline   Reply With Quote
Old 01/09/2017, 02:03 AM   #3
Big Clucker
NathanT's Avatar
Join Date: Jul 2016
Location: Brazil
Posts: 172
Reputation: 13
Default Re: CMath Library

Good work, it is very interesting adding practical functions of C++ to PAWN.
American State Roleplay
NathanT is offline   Reply With Quote

Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] CMath Library Jelly23 Lançamentos/Releases 10 20/04/2017 05:50 PM
[Map] Library SjuteL Maps 16 18/04/2016 01:56 PM
[MAP] Library. SjuteL Screenshots and Videos 8 13/04/2016 11:27 PM
[Include] CRF Library codectile Includes 22 15/01/2015 11:56 AM

All times are GMT. The time now is 05:25 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.