mirror of
https://github.com/corda/corda.git
synced 2025-01-17 02:09:50 +00:00
non-working implementation of float and double.toString()
This commit is contained in:
parent
45dc118ab9
commit
243d62a952
@ -69,3 +69,10 @@ Java_java_lang_System_doMapLibraryName(JNIEnv* e, jclass, jstring name)
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jint JNICALL
|
||||
Java_java_lang_Double_fillBufferWithDouble(JNIEnv *e, jclass me, jdouble val,
|
||||
jbyteArray buffer, jint bufferSize) {
|
||||
if (e or me or val or buffer or bufferSize) return 0;
|
||||
return 0;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -81,6 +81,15 @@ public class StringBuilder {
|
||||
return append(String.valueOf(v));
|
||||
}
|
||||
|
||||
public StringBuilder append(float v) {
|
||||
return append(String.valueOf(v));
|
||||
}
|
||||
|
||||
public StringBuilder append(double v) {
|
||||
return append(String.valueOf(v));
|
||||
}
|
||||
|
||||
|
||||
public char charAt(int i) {
|
||||
if (i < 0 || i >= length) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
|
Loading…
Reference in New Issue
Block a user