How can i convert jdouble of java type variable to double variable of type c ?
You don't have to, it's just a typedef like so:
typedef double jdouble;
So no conversion is needed, once you have a jdouble you can treat it just as a double.
See for instance this code example from Standford:
JNIEXPORT jdouble JNICALL Java_Summer_sum__DD
(JNIEnv *env, jobject jobj, jdouble j1, jdouble j2) {
return j1 + j2;
}
The addition is done directly with the jdouble values, trusting the compiler to figure out how to generate the required code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With