O'Reilly logo

Learning AWK Programming by Shiwang Kalkhanda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The sin (expr) function

The sin(expr) function returns the sine of the expression expr, where expr is expressed in radians. The following code block shows an example of a sine function:

$ vi sinefunc.awkBEGIN  {    print "sin(90) = ", sin(90);    print "sin(45) = ", sin(45);    }$ awk -f sinefunc.awk

The output of the execution of the previous code is as follows:

sin(90) =  0.893997sin(45) =  0.850904

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required