@Override
    public Value evaluate(Value... arguments) throws Exception
    {
        // Check the number of argument
        if (arguments.length == 1)
        {
            // get Value
            Value value = arguments[0];

            // If Double
            if (value.getType() == ValueType.DOUBLE)
                return new Value(new Double(Math.abs(value.getDouble())));

            // if integer
            if (value.getType() == ValueType.INTEGER)
                return new Value(new Integer(Math.abs(value.getInt())));

            // if integer
            if (value.getType() == ValueType.LONG)
                return new Value(new Long(Math.abs(value.getLong())));
            
            if (value.getType() == ValueType.ARRAY){
            	Value[] vector = value.getValues();
    			Value result[] = new Value[vector.length];
    			for (int i=0;i<vector.length;i++){
    				result[i]=evaluate(vector[i]);
    			}
    			return new Value(result);
            }
           

            // the type is incorrect
            throw new EvalException(this.name() + " function does not handle " + value.getType().toString() + " type");
        }

        // number of argument is incorrect
        throw new EvalException(this.name() + " function only allows one numerical parameter");
    }