1
0
şunun yansıması https://github.com/DanilaFe/abacus eşitlendi 2026-01-17 12:25:20 +00:00

Merge the new edge cases.

Bu işleme şunda yer alıyor:
2017-08-04 13:32:06 -07:00
işleme 8b9892636d

Dosyayı Görüntüle

@@ -331,12 +331,19 @@ public class StandardPlugin extends Plugin {
public static final Operator OP_CARET = new Operator(OperatorAssociativity.RIGHT, OperatorType.BINARY_INFIX, 2, new Function() {
@Override
protected boolean matchesParams(NumberInterface[] params) {
return params.length == 2;
return params.length == 2
&& !(params[0].compareTo(NaiveNumber.ZERO.promoteTo(params[0].getClass())) == 0
&& params[1].compareTo(NaiveNumber.ZERO.promoteTo(params[1].getClass())) == 0);
}
@Override
protected NumberInterface applyInternal(NumberInterface[] params) {
return FUNCTION_EXP.apply(FUNCTION_LN.apply(params[0]).multiply(params[1]));
if (params[0].compareTo(NaiveNumber.ZERO.promoteTo(params[0].getClass())) == 0) {
return NaiveNumber.ZERO.promoteTo(params[0].getClass());
} else if (params[1].compareTo(NaiveNumber.ZERO.promoteTo(params[0].getClass())) == 0) {
return NaiveNumber.ONE.promoteTo(params[1].getClass());
}
return FUNCTION_EXP.apply(FUNCTION_LN.apply(FUNCTION_ABS.apply(params[0])).multiply(params[1]));
}
});
/**