Search the web
Sign In
New User? Sign Up
javajousters · Java Algorithms Challenges Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
A newbie question   Message List  
Reply | Forward Message #822 of 846 |
Re: A newbie question

--- 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.




Wed Nov 28, 2007 9:48 am

timfoden
Offline Offline
Send Email Send Email

Forward
Message #822 of 846 |
Expand Messages Author Sort by Date

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: ...
Kermit Kiser
kermitkiser
Offline Send Email
Nov 9, 2007
10:08 pm

... 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...
Tim Foden
timfoden
Offline Send Email
Nov 28, 2007
9:48 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help