This week's book giveaway is in the Android forum.We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!See this thread for details.
Big Moose Saloon
 Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies Register / Login Win a copy of Head First Android this week in the Android forum!

Math

sanjana narayanan
Ranch Hand

Joined: Nov 25, 2003
Posts: 142
Hi,

The question is from one of the mock exam.
For which ranges of values is the sin method defined? (Choose all that apply.)
A. greater than or equal to 0.0
B. -PI / 2 through PI / 2
C. 0.0 through 360.0
I selected B but the ans given:B and C.
Pl comment on this.
-Sanjana
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
I could be wrong, but I seriously doubt that such a question would appear on the SCJP exam.
Perhaps you may want to be aware that the trigonometry functions in the Math class take arguments in radians, not degrees. But that knowledge would mostly be useful when actually using one of these methods (when you should be able to take a quick look at the documentation to figure it out). I doubt that you'll need to know it for the exam.
[ December 14, 2003: Message edited by: Dirk Schreckmann ]

Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
I agree with Dirk that it's exceedingly unlikely that this question would be asked in the exam. If it were though, the correct answer would be D: any double can be passed as a legal parameter to this function. The values repeat themselves every 2π radians, so you usually just take the sin of an angle in the range 0 to 2π, or -π to π. Regardless, just ignore this question. It's not a good question, and not a good answer. The mock exam is simply wrong in this case. Which mock exam was it, anyway?

"I'm not back." - Bill Harding, Twister
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8898

5
My two cents:
To just further what Jim said, if you understand that the trig methods work in radians, and how to convert in and out of radians, you'll be set for this exam topic.

Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)

I agree. Here's the link: http://aspose.com/file-tools

subject: Math