smath [ parameter=value ... ] [ inputfile ... ]
smath is a shell scripting tool that allows shell scripts to do real valued arithmetic. Any emath expression not involving variables, dimensions, or aggregates is allowed. To ensure the shell does not interpret special characters like ()'s , it is best to put the entire expression in single or double quotes. smath 1 + 2 and smath '1+2' give the same result (3), but the second form is safer and preferred.
In C, that would be:
printf("%.*f\n", decimal_places, result);
if the -f option is not used, then result is output using G
format and a
maximum of 10 total digits. In C that would be:
printf("%.10g\n", result);
set LAT = `etxinfo item=center_lat std_format=no $DATASET` set COS = `smath -d "cos($LAT)"`
none
Last Updated: $Date: 1999/05/10 20:46:21 $