02.01.2016, 21:48
Hi guys,
I have problem with dividing two integers. I don't remember I had that problem before :S
So, in main() I added simple printf for check
After I've compiled script and started the server, result was '0.00'. I'm not sure why I have this problem, I thought it was because I'm using rBits but it wasn't.
Also, if I divide two float numbers(eg. 5.5 / 2. I got right result. Same thing with dividing float with int and int with float values.
Problem is dividng with two int values but I don't Know where's a problem. I tried without includes I use and I got same problem.
I've tried with
And it gave me 2.00(like I wrote 5 % 2)
Thank You guys very much.
I have problem with dividing two integers. I don't remember I had that problem before :S
So, in main() I added simple printf for check
Код:
main() { print(">>> SUSTAV POKRENUT"); print("- Inacica skripte: "_HRP_SRVSETT_VR_L"."); print("- Zadnje azuriranje: "_HRP_SRVSETT_LSTUP" godine."); print("- Kodno ime skripte: "_HRP_SRVSETT_CNAME_VR"."); print("- Kodno ime azuriranja: "_HRP_SRVSETT_CNAME_UPD"."); print("- Zahvale: "_HRP_SVRSETT_CRDS"."); print("- Web adresa zajednice: "_HRP_SVRSETT_WEB"."); print("- Klijent inacica: "_HRP_SVRSETT_CLN_VR"."); print("- Server posluzitelj: "_HRP_SVRSETT_SRVHST"."); print("- Web posluzitelj: "_HRP_SVRSETT_WEBHST"."); print("- e-Mail zajednice: "_HRP_SVRSETT_MAIL"."); print(" "); printf("%.2f", 5 / 2); }
Also, if I divide two float numbers(eg. 5.5 / 2. I got right result. Same thing with dividing float with int and int with float values.
Problem is dividng with two int values but I don't Know where's a problem. I tried without includes I use and I got same problem.
Код:
// GLAVNI INCLUDEOVI #include <a_samp> #include <crashdetect> // ****** ZBIRKA #include <YSI\y_timers> #include <YSI\y_va> #include <YSI\y_hooks> // OSTALI INCLUDOVI #include <a_mysql> #define USE_OPTIMAL_MODE #include <new_funcs> #include <rBits> #include <easyDialog> #include <randomFloat> #include <streamer> #include <sscanf2> #include <LIFE-CMD> #include <e-Mail> #include <CTime>
Код:
new Float:_var = (5 / 2); printf("%.2f", _var);
Thank You guys very much.