dynamic evaluate(EvaluationType type, ContextModel context)

Evaluates this expression according to given type and context.

Source

evaluate(EvaluationType type, ContextModel context) {
    var argEval = arg.evaluate(type, context);

    if (type == EvaluationType.REAL) {
      if(argEval < 0) return -1.0;
      if(argEval == 0) return 0.0;
      if(argEval > 0) return 1.0;
    }

    throw new UnimplementedError('Can not evaluate sgn on ${type} yet.');
  }