Prints returning weird int values converted from floats.
#1

How come after I use the floatround it converts 5.4 to some weird number?

Code:
Print of Float- SmallZoneInf[z][x+2] = 5.40
Print of Int = 1085066496

printf("SmallZoneInf[z][x+2] = %0.2f", SmallZoneInf[z][x+2]);
printf("result = %d", floatround(SmallZoneInf[z][x+2], floatround_round));
Thanks
Reply
#2

Ok, so basically the number 1085066496 shows up when you try to display 5.4 as integer.

pawn Code:
#include <a_samp>

new Float:Test[2][2] = {
    { 5.4, 1.5 },
    { 5.4, 1.5 }
};

main() {
    printf("%d - %d", Test[0][0], floatround(Test[0][0], floatround_round));
    //1085066496 - 5
}
I can't reproduce your case though
Reply
#3

SmallZoneInf[z][x+2]

SmallZoneInf have the Float: tag?
Reply
#4

Quote:
Originally Posted by ReVo_
View Post
SmallZoneInf[z][x+2]

SmallZoneInf have the Float: tag?
Slap me now, thx. xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)