16.01.2012, 14:45
(
Последний раз редактировалось Slice; 23.03.2012 в 13:36.
)
Hey,
This is a simple include that provides support for unsigned multiplication, division, and modulo operations.
Similar to how float numbers work in PAWN, you just add the tag "unsigned" to the variable/number.
Brief example:
Download: unsigned.inc
This is a simple include that provides support for unsigned multiplication, division, and modulo operations.
Similar to how float numbers work in PAWN, you just add the tag "unsigned" to the variable/number.
Brief example:
pawn Код:
#include <a_samp>
#include <unsigned>
main () {}
public OnGameModeInit() {
new
unsigned:test1,
unsigned:test2
;
test1 = 1;
test2 = -1;
if (test2 > test1)
print("unsigned: -1 > 1"); // prints
printf("%d", test2 % 255); // 0
printf("%d", _:test2 % 255); // 254
printf("%d", -1000 % 255); // 20
printf("%d", unsigned:-1000 % 255); // 21
printf("%d", 0xFFFFFF9C / 5); // -20
printf("%d", unsigned:0xFFFFFF9C / 5); // 0x3333331F
printf("%d", 0xFFFFFFFF ); // -1
printf("%s", unsigned_string(0xFFFFFFFF)); // 4294967295
}