--- In javajousters@yahoogroups.com, Kermit Kiser <infire@...> wrote:
>
> Hi all;
>
> Still trying to figure all this stuff out. My question is: Should the
> line in the info doc (under additions to JJRobot class) that reads this
> way:
>
>
> double d_rnd(double val) - returns val, as a double.
>
>
> actually be the following:
>
>
> double d_rnd(int val) - returns val, as a double
>
> ?
>
> Thanks for your help,
> - Kermit
>
Hi Kermit,
No, I believe the documentation is right in this case.
The JJRobot.d_rnd() function takes a double as an argument and returns
a double. The returned value is rounded to the nearest integer (but
is still returned as a double).
It is defined in the source code like this:
static protected final double d_rnd(double value) {
return Math.floor(value + 0.5d);
}
Cheers, Tim.