Browse Source

Utilisation Math.min et Math.max

Arthur Brandao 6 years ago
parent
commit
4a9d462790
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/migl/lisp/operator/MinMaxOperator.java

+ 2 - 2
src/migl/lisp/operator/MinMaxOperator.java

@@ -47,10 +47,10 @@ public class MinMaxOperator implements LispOperator {
              double value = eval.getElement(lisp.car()).toNumber();
              switch(operator) {
 				case "max":
-					result = (value > result) ? value : result;
+					result = Math.max(value, result);
 					break;
 				case "min":
-					result = (value < result) ? value : result;
+					result = Math.min(value, result);
 					break;
 				default:
 					throw new LispError(operator + LispError.ERR_UNKNOW);