private static double convertCentimeterToInches(double d) {
double feetPart = 0;
double inchesPart = 0;
if (String.valueOf(d) != null && !String.valueOf(d).trim().isEmpty()) {
feetPart = Math.floor(convertCentimeterToInches(d) / 12);
inchesPart = Math.ceil(convertCentimeterToInches(d) - (feetPart * 12));
}
return inchesPart;
}
06 - 01 02: 25: 08.037: E / XXX(1099): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java: 352)
06 - 01 02: 25: 08.037: E / XXX(1099): at java.util.concurrent.FutureTask.setException(FutureTask.java: 219)
06 - 01 02: 25: 08.037: E / XXX(1099): at java.util.concurrent.FutureTask.run(FutureTask.java: 239)
06 - 01 02: 25: 08.037: E / XXX(1099): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java: 230)
06 - 01 02: 25: 08.037: E / XXX(1099): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1080)
06 - 01 02: 25: 08.037: E / XXX(1099): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: 573)
06 - 01 02: 25: 08.037: E / XXX(1099): at java.lang.Thread.run(Thread.java: 856)
06 - 01 02: 25: 08.037: E / XXX(1099): Caused by: java.lang.StackOverflowError
06 - 01 02: 25: 08.037: E / XXX(1099): at java.lang.RealToString.longDigitGenerator(RealToString.java: 269)
06 - 01 02: 25: 08.037: E / XXX(1099): at java.lang.RealToString.convertDouble(RealToString.java: 111)
06 - 01 02: 25: 08.037: E / XXX(1099): at java.lang.RealToString.doubleToString(RealToString.java: 59)
06 - 01 02: 25: 08.037: E / XXX(1099): at java.lang.Double.toString(Double.java: 317)
06 - 01 02: 25: 08.037: E / XXX(1099): at java.lang.String.valueOf(String.java: 1625)
I am just thinking on why its throwing stackoverflow error, when everything seems to be perfect in double. There is no conversion happening from double to int or float
which could result in stackoverflow.