30.05.2011, 16:51
I was curious to something, and decided to use PAWN to work out the speed (dont ask why I was just bored)
I ran this:
which returned 938017875
How is that possible?
distance is KM so 0.1 KM = 100 mtrs
time is seconds so 3600 seconds is 1 hour
When I put this in my calculator I get 0.000027777
Is this because there is a limitation to pawn that it can't give out 0.000027777?
But then I run it like this:
and I get answer 1065353216
but 1.0/1.0 = 1
what is happening here? Im really confused..
I ran this:
pawn Код:
#include <a_samp>
main()
{
new Float:dis=0.1,
Float:time=3600,
Float:speed = 0;
speed = (dis/time);
printf("%d",speed);
}
How is that possible?
distance is KM so 0.1 KM = 100 mtrs
time is seconds so 3600 seconds is 1 hour
When I put this in my calculator I get 0.000027777
Is this because there is a limitation to pawn that it can't give out 0.000027777?
But then I run it like this:
pawn Код:
#include <a_samp>
main()
{
new Float:dis=1.0,
Float:time=1.0,
Float:speed = 0;
speed = (dis/time);
printf("%d",speed);
}
but 1.0/1.0 = 1
what is happening here? Im really confused..