mirror of
https://github.com/corda/corda.git
synced 2025-06-17 14:48:16 +00:00
non-working implementation of float and double.toString()
This commit is contained in:
@ -69,3 +69,10 @@ Java_java_lang_System_doMapLibraryName(JNIEnv* e, jclass, jstring name)
|
|||||||
}
|
}
|
||||||
return r;
|
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) {
|
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() {
|
public byte byteValue() {
|
||||||
@ -67,6 +69,9 @@ public final class Double extends Number {
|
|||||||
throw new NumberFormatException(s);
|
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 long doubleToRawLongBits(double value);
|
||||||
|
|
||||||
public static native double longBitsToDouble(long bits);
|
public static native double longBitsToDouble(long bits);
|
||||||
|
@ -81,6 +81,15 @@ public class StringBuilder {
|
|||||||
return append(String.valueOf(v));
|
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) {
|
public char charAt(int i) {
|
||||||
if (i < 0 || i >= length) {
|
if (i < 0 || i >= length) {
|
||||||
throw new IndexOutOfBoundsException();
|
throw new IndexOutOfBoundsException();
|
||||||
|
Reference in New Issue
Block a user