double (String value, String complexMax, String complexMin) { Pair<Double, Double> med = parsePyComplex(value); Pair<Double, Double> max = parsePyComplex(complexMax); Pair<Double, Double> min = parsePyComplex(complexMin); if (med == null || min == null || max == null) { return 0; } double range = (med.first - min.first) / (max.first - min.first); if (max.first.equals(min.first)) { range = (med.second - min.second) / (max.second - min.second); } return range; }