Retro Rocket OS
BASIC-Powered Operating System
Loading...
Searching...
No Matches
DEG Function
DEG(real-expression)

Converts an angle from radians to degrees. The result is a real number.


Examples

PRINT DEG(PI#)

Produces 180.

PRINT DEG(PI# / 2)

Produces 90.

REM Round-trip conversion
angle# = 45
PRINT "Radians = "; RAD(angle#)
PRINT "Degrees = "; DEG(RAD(angle#))

Notes

  • Conversion formula: degrees = radians * 180 / PI.
  • Returned as a real value; may not be an integer if the input is not an exact multiple of π/180.
  • Useful for displaying angles calculated in radians to users in degrees.

See also: RAD · SIN · COS · TAN