String max_value0 ="1/3";double imax_value0 = Double.valueOf(max_value0).intValue();或
float imin_value0 =  Float.valueOf(max_value0).intValue();有问题,应如何转化!

解决方案 »

  1.   

    double imax_value0 = new Double(1/3).doubleValue() ;就可以了
      

  2.   


    String max_value0 ="1/3";double imax_value01 = new Double(max_value0).doubleValue();这样就不好用?怪
      

  3.   

    String s = "1/3";
    double d = Double.parseDouble(s.substring(0,s.indexOf('/'))) / 
    Double.parseDouble(s.substring(s.indexOf('/')+1));
    System.out.println(d);这样吧。照你的想法,难道Double.parseDouble("1+2/3");都可以用了~
      

  4.   


     treeroot(旗鲁特)
     
     应当如何用才算正确?
      

  5.   


    按照foxty(狐狸糊涂)  的方法才可行吧
      

  6.   

    Double.valueOf(String s)
    参数:
    s - 要分析的字符串。 
    返回:
    保存用 String 参数表示的值的 Double 对象。 
    抛出: 
    NumberFormatException - 如果字符串不包含可分析的数字。
      

  7.   

    foxty(狐狸糊涂) 正解
    运行过了。
    其它的不能正确运行。二楼解析出来的Double是0。00000000000