Timeline for Why does my rectangle move faster in one direction than in the opposite?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 8, 2015 at 2:40 | comment | added | benny.bennett | Keep in mind, they do not "round toward 0," they truncate. This distinction is important. For instance, 1.9999 truncates to 1 and 2.0001 truncates to 2. That's where this unexpected behavior is most likely occurring, in the truncation. | |
Aug 25, 2015 at 2:33 | history | edited | Fuzzy Logic | CC BY-SA 3.0 |
made example more clear
|
Aug 25, 2015 at 2:29 | comment | added | Kyranstar | Oh, good point. | |
Aug 25, 2015 at 2:29 | comment | added | Fuzzy Logic |
Yes, they will but screen coords are never negative.. so bad example on my part. Try 5-1.6 = 3 , not 4
|
|
Aug 25, 2015 at 2:12 | comment | added | Kyranstar |
Don't ints round towards 0? I ran this code System.out.println((int) -1.7); on my machine and it printed -1. But still, he shouldn't be storing coordinates as ints.
|
|
Aug 23, 2015 at 9:17 | vote | accept | Oliver-R | ||
Aug 22, 2015 at 22:56 | history | edited | Fuzzy Logic | CC BY-SA 3.0 |
correction
|
Aug 22, 2015 at 22:49 | history | answered | Fuzzy Logic | CC BY-SA 3.0 |