Just found one now
Clever Code
3
Posts
2
Posters
11
Views
1
Watching
-
-
int speed = thrust*10/mass; int range = (propellant*speed)/propConsume; do you see it? No, neither did I. Its the old, old rounding error again. This is the fix: int speed = thrust*10/mass; int range = (propellant*thrust*10)/(propConsume*mass);
Why not use floats or doubles instead of ints, and then truncate them to ints if needed? (I've encountered this problem many times also)
- S 50 cups of coffee and you know it's on!
-
Why not use floats or doubles instead of ints, and then truncate them to ints if needed? (I've encountered this problem many times also)
- S 50 cups of coffee and you know it's on!