AWK – Exponential Operators

  • Post author:
  • Post category:AWK
  • Post comments:2 Comments
AWK - Exponential Operators

This topic is about AWK – Exponential Operators.

There are two formats of exponential operators −

Exponential Format 1

It is an exponential operator that raises the value of an operand. For instance, the following example raises the value of 10 by 2.

Example

[jerry]$ awk 'BEGIN { a = 10; a = a ^ 2; print "a =", a }'

On executing this code, you get the following result −

Output

a = 100

Exponential Format 2

It is an exponential operator that raises the value of an operand. For instance, the following example raises the value of 10 by 2.

Example

[jerry]$ awk 'BEGIN { a = 10; a = a**2; print "a =", a }'

On executing this code, you get the following result

Output

a = 10

In this topic we learned about AWK – Exponential Operators. To know more, Click Here.

This Post Has 2 Comments

Leave a Reply