mirror of
https://github.com/corda/corda.git
synced 2025-01-01 02:36:44 +00:00
Implemented printing of doubles using snprintf
This commit is contained in:
parent
243d62a952
commit
7bc85a1247
@ -71,8 +71,11 @@ Java_java_lang_System_doMapLibraryName(JNIEnv* e, jclass, jstring name)
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jint JNICALL
|
||||
Java_java_lang_Double_fillBufferWithDouble(JNIEnv *e, jclass me, jdouble val,
|
||||
Java_java_lang_Double_fillBufferWithDouble(JNIEnv *e, jclass, jdouble val,
|
||||
jbyteArray buffer, jint bufferSize) {
|
||||
if (e or me or val or buffer or bufferSize) return 0;
|
||||
return 0;
|
||||
jboolean isCopy;
|
||||
jbyte* buf = e->GetByteArrayElements(buffer, &isCopy);
|
||||
jint count = snprintf(reinterpret_cast<char*>(buf), bufferSize, "%g", val);
|
||||
e->ReleaseByteArrayElements(buffer, buf, 0);
|
||||
return count;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public final class Float extends Number {
|
||||
}
|
||||
|
||||
public static String toString(float v) {
|
||||
return "Float.toString: todo";
|
||||
return Double.toString(v);
|
||||
}
|
||||
|
||||
public byte byteValue() {
|
||||
|
Loading…
Reference in New Issue
Block a user