Posts: 62
Threads: 8
Joined: Jan 2011
Reputation:
0
I had a problem with floats.
static Float:testnumber = 3.01;
printf("%f", testnumber);
Results:
3.00.
Do you have any idea why I'm having 3.00 instead of 3.01?
Thanks.
Posts: 62
Threads: 8
Joined: Jan 2011
Reputation:
0
new Float:number = 0.01;
printf("%.2f", number);
Results: 0.00
new Float:number = 0.01;
printf("%.3f", number);
Results: 0.009
Posts: 62
Threads: 8
Joined: Jan 2011
Reputation:
0
Anyone have an idea why it doesn't give the right float?
Posts: 62
Threads: 8
Joined: Jan 2011
Reputation:
0
I don't think so, otherwise it would be 0.01 instead of 0.009.
Posts: 62
Threads: 8
Joined: Jan 2011
Reputation:
0
Sorry for double post, I found the problem.
If you want 0.01 then you can just add 0.001 to 0.009 which equals 0.01