non-working implementation of float and double.toString()

This commit is contained in:
Eric Scharff
2007-10-02 08:58:35 -06:00
parent 45dc118ab9
commit 243d62a952
3 changed files with 22 additions and 1 deletions

View File

@ -35,7 +35,9 @@ public final class Double extends Number {
}
public static String toString(double v) {
return "Double.toString: todo";
byte[] buffer = new byte[20];
int numChars = fillBufferWithDouble(v, buffer, 20);
return new String(buffer, 0, numChars, false);
}
public byte byteValue() {
@ -67,6 +69,9 @@ public final class Double extends Number {
throw new NumberFormatException(s);
}
public static native int fillBufferWithDouble(double value, byte[] buffer,
int charCount);
public static native long doubleToRawLongBits(double value);
public static native double longBitsToDouble(long bits);