Exponential expressions

There are two formats of exponential operators:

Exponential format 1 (^):

This is an exponential operator that raises the value of an operand. For example, the following example raises the value of 5 by the power of 3:

$ awk 'BEGIN { a = 5; a = a ^ 3; print "a ^ 3 =",a }'

The output on execution of the preceding code is as follows:

a ^ 3 = 125 

Exponential format 2 (**):

This also raises the value of an operand. For example, the following example raises the value of 5 by the power of 3:

$ awk 'BEGIN { a = 5; a = a ** 3; print "a ** 3 =",a }'

The output on execution of the preceding code is as follows:

a ** 3 = 125
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.162.26