#!/bin/csh -f #+ # abs -- return the absolute value # # Purpose: # Compute the absolute value of an expression # # Usage: # abs x # # Arguments: # x = value or expression to be evaluated # # Output: # Prints the absolute value of x on the terminal # # Exit values: # 0 = normal completion # # Example: # 1) Compute absolute value of a simple value: # abs -1.2345 # returns "1.2345" # 2) Compute absolute value of an expression using Cshell variables: # set a = -1.2345 # set b = 10 # abs $a + $b # returns "8.7655" # abs "$a * $b" # returns "12.345" #- # Modification history: # 2000-Jul-04 GDW Original version #----------------------------------------------------------------------- calc "abs($*)"