Javatpoint Logo
Javatpoint Logo

Java Math.toDegrees() method

The java.lang.Math.toDegrees() is a built-in math function in java which is used to convert an angle measured in radians to an approximately equivalent angle measured in degrees.

Syntax

Parameter

Return

  • If the argument is NaN, this method will return NaN.
  • If the argument is zero, this method will return zero with the same sign as the argument.
  • If the argument is infinity, this method will return infinity with the same sign as the argument.

Example 1

Test it Now

Output:

180.0

Example 2

Test it Now

Output:

90.0

Example 3

Test it Now

Output:

-Infinity

Example 4

Test it Now

Output:

0.0

Next TopicJava Math





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA