This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes which is valid ?Math.cos(56)or ....... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "which is valid ?Math.cos(56)or ......." Watch "which is valid ?Math.cos(56)or ......." New topic

which is valid ?Math.cos(56)or .......

wei liu
Ranch Hand

Joined: Dec 06, 2001
Posts: 56
which is valid ?Math.cos(56)or Math.cos(Math.toRadians(56))orMath.cos(Math.toDegrees(56))
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6328

Depends on what the units of 56 are. The API JavaDocs clearly state that the arguments for the trigonometric functions are angles in radians.
(Please bookmark the above link for your future reference -- you'll learn a lot more, a lot faster by trying to look things up yourself)

Junilu - [How to Ask Questions] [How to Answer Questions]
I agree. Here's the link:
subject: which is valid ?Math.cos(56)or .......
It's not a secret anymore!