例如这里,这个 calculateVolume() 使用双打
private double myRadius;
private double myVolume;
private double mySurfaceArea;
private final static double pi = 3.14;
public double calculateVolume(){
myVolume = (4.0/3)*pi*(Math.pow(myRadius,3));
return myVolume;
}
当我给 myRadius 赋值 6 时,它返回 904.3199999999999。有没有办法让它成为 904.32?