The `sqrt(expr)` function returns the positive square root for the given integer evaluated from the `expr `expression. This function also requires a positive number as an argument; otherwise, it returns an error message `NaN` for a negative number. It also prints a warning message if a negative number is used as an argument. The following code block shows an example of a `sqrt (expr)` function:

$ vi sqrtfunc.awkBEGIN { print "sqrt(5) = ", sqrt(5); print "sqrt(0) = ", sqrt(0); print "sqrt(-5) = ", sqrt(-5); }$ awk -f sqrtfunc.awk

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

sqrt(5) = 2.23607sqrt(0) = 0awk: sqrtfunc.awk:4: warning: sqrt: called with negative argument -5sqrt(-5) = -nan