가능하다 "텍스트"예를 들어 값longBitsToDouble, 반올림하지 않고, 그것이 내가이 코드 조각이
public static String binStringToRealString(String text, int precision) {
String result = "";
long longBits;
Double doubleValue;
text = "0011111111110001100110011001100110011001100110011001100110011010";
longBits = Long.parseLong(text, 2);
Log.d(TAG, "longBits = " + longBits);
// longBits = 4607632778762754458
doubleValue = Double.longBitsToDouble(longBits);
Log.d(TAG, "doubleValue = " + doubleValue);
// doubleValue = 1.1
result = doubleValue.toString();
Log.d(TAG, "result = " + result);
return result;
}
에 강제는 어떻게 든있는 doubleValue를 반올림하지받을 수 있습니까?
실제 값은 내가 라운딩을 중지하려면 어떻게해야합니까이 변환기 http://www.binaryconvert.com/result_double.html?hexadecimal=3FF199999999999A
처럼 1.10000000000000008881784197001
입니까?
결과가 웹 사이트보다 나을 것이라고 생각합니다. 감사! – Milan