[Plugin] CMath Library
#1

• 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

Functions:
Code:
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);
Examples:
PHP Code:
//Example: native Float:frexp(Float:x, &exp); 
main() 

     new 
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); 
main() 

      new 
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); 

/* 
Output: 
numerator: 10.300000 
denominator: 4.500000 
remainder: 1.300000 
quotient: 2 
*/ 
-Thanks to Dayvison_ for linux binary.

Download

Github
Reply
#2

Good Plugin
Reply
#3

Good work, it is very interesting adding practical functions of C++ to PAWN.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)