I have tried to separate 5.6 (for example) by the following method:
private static double[] method(double d) { int integerPart = 0; double fractionPart =
poor-man solution (using String)
static double[] sp(double d) { String str = String.format(Locale.US, "%f", d); int i = str.indexOf('.'); return new double[] { Double.parseDouble(str.substring(0, i)), Double.parseDouble(str.substring(i)) }; }
(Locale so we really get a decimal point)