floatdiv mystic mistakes
#1

Hey all together.
Currently, im using this snippet:
Code:
pl_stats[killerid][dmratio] = floatdiv(float(pl_stats[killerid][dmwins]),float(pl_stats[killerid][dmlosses]));
But sometimes is the result :
Quote:

./,),(-*,(

I dont know, when this occurs.
Probably someone can tell me, how i can prevent this ?
Reply
#2

How are you using your formats?
You have to use %f.
Reply
#3

Of course,
Code:
new winform[128];
		format(winform,128,"%s-dmkills",hdwid[killerid]);
	 	pl_stats[killerid][dmwins] = INI_ReadInt(winform);
		format(winform,128,"%s-dmdeath",hdwid[killerid]);
		pl_stats[killerid][dmlosses] = INI_ReadInt(winform);
	  pl_stats[killerid][dmwins]+=1;
	  pl_stats[killerid][dmratio] = floatdiv(float(pl_stats[killerid][dmwins]),float(pl_stats[killerid][dmlosses]));
	  format(winform,128,"%s-dmratio",hdwid[killerid]);
		INI_WriteFloat(winform,pl_stats[killerid][dmratio]);
Reply
#4

floatdiv divides two floats, and thats what i do...

Ill try...
Reply
#5

I usually get ./,),(-*,( whenever a number equals out to be the same as 0x80000000.


pawn Code:
printf("%d",0x80000000);
Reply
#6

What does this means to me ?
How can i check for this ?
When its caused ?
Reply
#7

It's very simple. It's a division by zero what causes this.

(Sry for reviving old topics but probably someone else has the same problem and finds this thread via ****** or the forum search)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)