(isPlusClicked || op == '+'){
long result = 0;
String finaldata = edt.getText().toString();
finaldata = finaldata.replace("(", "");
finaldata = finaldata.replace(")", "");
System.out.println(" the string is now ==== "+edt.getText().toString());
String[] total = finaldata.split("\\+");
System.out.println(" *************** "+total[0] + "************** "+total[1]);
System.out.println(" the index in the string array are ..... "+sb.toString());
ArrayList<String> alvalue = new ArrayList<String>();
System.out.println(" the splited number is ==== "+total[0] +" the second number is "+total[1]);
StringBuilder sb1 = new StringBuilder(edt.getText().toString());
int inc = 0;
for(int i = 0;i<sb1.length() ; i++){
char plus = sb1.charAt(i);
if(plus == '+'){
String[] totaly = finaldata.split("\\+| \\++ | \\+++");
if(inc>=1){
System.out.println(" *******inc value with result is ***************** "+result+"?&&&&&& "+inc);
result = result + Long.parseLong(totaly[inc+1]);
}else if(inc<=0){
result = Long.parseLong(totaly[inc]) + Long.parseLong(totaly[inc+1]);
//double myDouble = new Long(result).doubleValue();
System.out.println(" Second value is---- ---- "+totaly[inc+1]);
}
inc = inc +1;
}
edt.setText("");
edt.setText( String.valueOf(result));
}
}
たとえば、値を double に入れている場合: 12345678+32164 よりも ans:5.12377842E8 を取得し、122.81+212.122 よりも Long に変換しようとすると、Zero(0) の回答が返されるので、何をしているのか教えてください。 ? 正解のために