docs.intersystems.com
InterSystems IRIS Data Platform 2019.2  /  InterSystems SQL Reference  /  SQL Functions

InterSystems SQL Reference
DEGREES
Previous section           Next section
InterSystems: The power behind what matters   
Search:  


A numeric function that converts radians to degrees.
Synopsis
DEGREES(numeric-expression)

{fn DEGREES(numeric-expression)}
Arguments
numeric-expression The measure of an angle in radians. An expression that resolves to a numeric value.
DEGREES returns either the NUMERIC or DOUBLE data type. If numeric-expression is data type DOUBLE, DEGREES returns DOUBLE; otherwise, it returns NUMERIC.
DEGREES can be specified as either a standard scalar function or an ODBC scalar function with curly brace syntax.
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 value has a default precision of 36 and a default scale of 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


Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-10-22 04:57:16