jfloat to C float
843829Aug 12 2003 — edited Aug 13 2003Hi, im playing JNI and I send an array of floats from java to my C native function. However when i printf the values of the floats they are not the correct values...what am i doing wrong?
C code:
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj,jfloatArray arr)
{
jfloat body = (env)->GetFloatArrayElements(env, arr, 0);
aziD = body[0];
eleD = body[1];
printf("After -> Azimuth:%d Elevation:%d\n",aziD,eleD);
(*env)->ReleaseFloatArrayElements(env, arr, body, 0);
return;
}
/////////////////////////////
java values: 1.2 .04
c values: 1073741824 1072902963
//////////////////////////////