Added ternary versions of min and max.

Dieser Commit ist enthalten in:
TomyLobo 2011-10-27 18:48:01 +02:00
Ursprung ef5fba0f05
Commit 9c070c323f

Datei anzeigen

@ -89,10 +89,18 @@ public final class Functions {
return Math.min(a.invoke(), b.invoke());
}
public static final double min(Invokable a, Invokable b, Invokable c) throws Exception {
return Math.min(a.invoke(), Math.min(b.invoke(), c.invoke()));
}
public static final double max(Invokable a, Invokable b) throws Exception {
return Math.max(a.invoke(), b.invoke());
}
public static final double max(Invokable a, Invokable b, Invokable c) throws Exception {
return Math.max(a.invoke(), Math.max(b.invoke(), c.invoke()));
}
public static final double ceil(Invokable x) throws Exception {
return Math.ceil(x.invoke());