Skip to content

Commit

Permalink
Fixed rounding errors for int conversion in pos classes
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGuardsman committed Apr 23, 2017
1 parent 1ba6603 commit 8ba34dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/builtbroken/jlib/data/vector/Pos2DBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public float xf()

public int xi()
{
return (int)x;
return (int)Math.floor(x);
}


Expand All @@ -53,7 +53,7 @@ public float yf()

public int yi()
{
return (int)y;
return (int)Math.floor(y);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/builtbroken/jlib/data/vector/Pos3D.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public float zf()

public int zi()
{
return (int) z;
return (int)Math.floor(z);
}

/**
Expand Down

0 comments on commit 8ba34dc

Please sign in to comment.