DivideBy
See javadoc - uk.gov.gchq.koryphe.impl.function.DivideBy
Available since Koryphe version 1.0.0
Divide the input integer by the provide number. x -> [x/divideBy, remainder]
Examples
Divide by 2
Java
JSON
Full JSON
Python
final DivideBy function = new DivideBy(2);
{
"class" : "DivideBy",
"by" : 2
}
{
"class" : "uk.gov.gchq.koryphe.impl.function.DivideBy",
"by" : 2
}
g.DivideBy(
by=2
)
Input type:
java.lang.Integer
Example inputs:
Input Type | Input | Result Type | Result |
---|---|---|---|
java.lang.Integer | 6 | [java.lang.Integer, java.lang.Integer] | [3, 0] |
java.lang.Integer | 5 | [java.lang.Integer, java.lang.Integer] | [2, 1] |
null | null | ||
java.lang.Double | 6.1 | ClassCastException: java.lang.Double cannot be cast to java.lang.Integer |