} public double calcuvalue() { long start = System.currentTimeMillis(); Date d = new Date(); long now = d.getTime(), dif; char ch; boolean minusflag = false, multiflag = false, dividflag = false; double total = 0, next = 0, num = 0; //next used to be * or / while(index < len_of_str) { num = getnextnum(); if(err != -1) { System.out.println("err!?! try to getnextnum but " + " the char at index " + err + " is wrong "); return 0; } System.out.println("index after " + index);
ch = getnextop(); if(err != -1) { System.out.println("err!?! try to getnextop but " + " the char at index " + err + " is wrong "); return 0; } System.out.println("index after " + index);
switch (ch) { case '+':
if(multiflag) { next = next * num; } else if(dividflag) { next = next / num; } else { next = num; } if(minusflag) { next = -next; }