Skip to main content

DEGREES

A numeric function that converts radians to degrees.

Synopsis

DEGREES(numeric-expression)

Arguments

Argument Description
numeric-expression The measure of an angle in radians. An expression that resolves to a numeric value.

Description

DEGREES takes an angle measurement in radians and returns the corresponding angle measurement in degrees. DEGREES returns NULL if passed a NULL value.

The returned data type is NUMERIC unless numeric-expression is data type DOUBLE, in which case the returned data type is DOUBLE. The default precision is 36. The default scale is 18.

You can use the RADIANS function to convert degrees to radians.

Examples

The following Embedded SQL example returns the degree equivalents corresponding to the radian values 0 through 6:

   SET a=0
   WHILE a<7 {
   &sql(SELECT DEGREES(:a) INTO :b)
   IF SQLCODE'=0 {
     WRITE !,"Error code ",SQLCODE
     QUIT }
   ELSE {
     WRITE !,"radians ",a," = degrees ",b
     SET a=a+1 }
   }

See Also

FeedbackOpens in a new tab