Guest User

float2.inc

a guest
Jul 14th, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.67 KB | None | 0 0
  1. /*
  2.     float2.inc
  3.     kvann 2015, no rights reserved at all.
  4. */
  5.  
  6. #include <a_samp>
  7.  
  8. #if defined _float2_included
  9.         #endinput
  10. #endif
  11. #define _float2_included
  12.  
  13. /*
  14.     native Float:floatmod(Float:oper1, Float:oper2);
  15. */
  16.  
  17. stock Float:floatmod(Float:oper1, Float:oper2)
  18. {
  19.     while (oper1 >= oper2) oper1 -= oper2;
  20.     while (oper1 < 0.0) oper1 += oper2;
  21.     return oper1;
  22. }
  23.  
  24. native operator=(Float:oper) = floatround;
  25.  
  26. stock Float:operator%(Float:oper1, Float:oper2) return floatmod(oper1, oper2);
  27. stock Float:operator%(oper1, Float:oper2) return floatmod(float(oper1), oper2);
  28. stock Float:operator%(Float:oper1, oper2) return floatmod(oper1, float(oper2));
Advertisement
Add Comment
Please, Sign In to add comment