
// Script function: Define functions, e.g. the abs() function to return an absolute value

// Unless named starting with GlobalSino, EM, My, Self, the function commands are defined 
//by Gatan DM, please see at link: http://www.globalsino.com/EM/page2597.html


number EMabs(number i) // Define the abs() function to return an absolute value
{
if(i<0) return -i;
else return i;
}

number EMabs(number d, number e)
{
if(d>0) return -d;
else return d;
}

number EMabs(number f, number g, number h)
{
if(f>0) return 1/f;
else return f;
}

result (EMabs(-10) + "\n")
result (EMabs(-11, 0) + "\n")
result (EMabs(10, 2, 12) + "\n\n")
