Help

Alright, i'm using Murach's Beginning java 2 book thingy and well i'm having a small bit of trouble with using the rounding features. I'm only into chapter 6ish so i'm absolutely confused about most java termonology and cant figure what enumerations are or how to use them but anyways. i have this code here >

public static int Mod1(int str)

{

long ImodStr = (str - 10) / 2;

int modStr = Math.round(ImodDex);

return modStr;

}

And i want to get the decimals to round to the FLOOR without having to go and rewire a bunch of stuff. So anyone have any suggestions for me or could just provide me with code that would round this stuff to the FLOOR, and if you do i still need the return data to be integer form.

Thanks!

Message was edited by:

dndjunky

Message was edited by:

dndjunky

[867 byte] By [dndjunkya] at [2007-10-2 20:10:10]
# 1
I'm not entirely sure of your question, but if your looking for the FLOOR of a value, you can use the static Math.floor() method.
EvolvedAnta at 2007-7-13 22:50:44 > top of Java-index,Other Topics,Java Game Development...
# 2
Well i want the decimals to round to the floor so like a -1.5 becomes a -2 but i kinda discovered a way to solve my problem. Thanks for the help and i'll try that method.
dndjunkya at 2007-7-13 22:50:44 > top of Java-index,Other Topics,Java Game Development...