projects
/
monky
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fixed round_to_int to handle negative numbers properly
[monky]
/
src
/
common.c
diff --git
a/src/common.c
b/src/common.c
index
ae1db7c
..
9001178
100644
(file)
--- a/
src/common.c
+++ b/
src/common.c
@@
-289,5
+289,9
@@
void update_stuff()
int round_to_int(float f)
{
- return (int) (f + 0.5);
+ if (f >= 0.0) {
+ return (int) (f + 0.5);
+ } else {
+ return (int) (f - 0.5);
+ }
}