Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Expression

Status
Not open for further replies.

calabrra

Technical User
Sep 16, 2003
14
US
Question: Would the AWK conditional expression:

function abs(x) {
x >= 0 ? x : -x ;
return(x) ;
}

return the absolute value or simply the input argument?

Thanks,
-Bob
 
It would return the absolute value. However, the variable passed to the function would not be changed i.e. arguments are passed by value not by reference.

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top