If a guy walking on a road carries 1000 grams, his speed is calculated (10 - (1000/5000)) = 9,8
Is his speed rounded down, to the closest whole pixel or stay at that exact number?
The speed is:
a. 9
b. 10
c. 9.8
Would be interesting to know how it is.
Travel Speed
Moderators: Public Relations Department, Players Department
-
Andu
- Posts: 685
- Joined: Wed Aug 06, 2008 5:29 pm
- Location: Finland
Travel Speed
"An those with little fuel, could tie a pack of bears in front of their limousine, with whip and crossbow in hands to keep them in line."
- EchoMan
- Posts: 7768
- Joined: Fri Aug 26, 2005 1:01 pm
- Location: Stockholm, Sweden
Re: Travel Speed
The "speed" variable in the db is an integer, but the code doesn't round anything, so default rounding behaviour of MySQL applies. E.g:
Code: Select all
9.49999999999... is rounded down to 9
9.50000000000... is rounded up to 10
-
Andu
- Posts: 685
- Joined: Wed Aug 06, 2008 5:29 pm
- Location: Finland
Re: Travel Speed
Yay, thanks! 
"An those with little fuel, could tie a pack of bears in front of their limousine, with whip and crossbow in hands to keep them in line."
Return to “General Discussion”
Who is online
Users browsing this forum: No registered users and 1 guest
