Search code examples
cobolgnucobol

ATAN DEGREES IN COBOL?


I have a little problem I don't know tow to turn in deegrees my ATAN/ASIN/ACOS function in cobol This is the code:

                     ACCEPT A
                       COMPUTE C= FUNCTION ATAN(A)
                           END-COMPUTE
                          DISPLAY "Computing."
               DISPLAY "Computing.."
               DISPLAY "Computing..."
               DISPLAY "Computing...."
               DISPLAY "Computing....."
               DISPLAY "Computing......"
               DISPLAY "LA TANGENTE^-1 DI " A " RISULTA..."
                           DISPLAY C " GRADI"

Have you ideas? The (A * 180 /3.14) idea that I had doesen't work, for example, my scientific calc says that tan^-1 of 15 is 86.1, and the COBOL program says, with only A, 0000001.5042281, and with (A * 180 /3.14) says 0000001.5696333 Have you ideas?


Solution

  • The 1.5042281 is the result in radian. So to get them in degree just divide the result with Pi and multiply with 180, giving you 86.1