title: How can I assign the NULL to a float/double variable?
body: <p>I have a problem using JNI.
  </p>
  
  <pre><code>jboolean z = (jboolean) NULL; // ok
  jbyte    b = (jbyte)    NULL; // ok
  jchar    c = (jchar)    NULL; // ok
  jshort   s = (jshort)   NULL; // ok
  jint     i = (jint)     NULL; // ok
  jlong    j = (jlong)    NULL; // ok
  
  jobject  l = (jobjec)   NULL; // ok
  
  jfloat   f = (jlong)     NULL; // NOT OK 
  jdouble  d = (jdouble)   NULL; // NOT OK
  </code></pre>
  
  <p>Compiler complaines</p>
  
  <pre><code>[ERROR] /....c:112:28: error: pointer cannot be cast to type 'jfloat' (aka 'float')
  [ERROR]   jfloat result = (jfloat) NULL;
  [ERROR]                            ^~~~
  [ERROR] /usr/include/sys/_types/_null.h:29:15: note: expanded from macro 'NULL'
  [ERROR] #define NULL  __DARWIN_NULL
  [ERROR]               ^~~~~~~~~~~~~
  [ERROR] /usr/include/sys/_types.h:52:23: note: expanded from macro '__DARWIN_NULL'
  [ERROR] #define __DARWIN_NULL ((void *)0)
  [ERROR]                       ^~~~~~~~~~~
  [ERROR] 1 error generated.
  </code></pre>
  
  <p>How can I fix this?</p>
  
  <hr>
  
  <p>I'm writing methods for each of those values.
  </p>
  
  <pre><code>jboolean doSome() {
      jboolean result = (jboolean) NULL;
      /*
       * at here result may be initialized or remain as NULL
       */
      return result;
  }
  </code></pre>
  
  <hr>
  
  <p>I intended to write a function combines following three methods.
  </p>
  
  <pre><code>(*env)-&gt;GetObjecClass(JNIEnv *, jobject);
  (*env)-&gt;GetMethodID(JNIEnv *, jclass, char *, char *);
  (*env)-&gt;CallBooleanMethodA(JNIEnv *, jclass, jmethodID, jvalue *);
  </code></pre>
  
  <p>like this.
  </p>
  
  <pre><code>jboolean CallBooleanMethodAMmMs(JNIEnv * env, jobject obj, char * mname,
                                  char * msig, jvalue * args) {
    jboolean result = (jboolean) NULL;
    jclass clazz = (*env)-&gt;GetObjectClass(env, obj);
    jmethodID methodID = (*env)-&gt;GetMethodID(env, clazz, mname, msig);
    if (methodID != NULL) {
      result = (*env)-&gt;CallBooleanMethodA(env, obj, methodID, args);
    }
    (*env)-&gt;DeleteLocalRef(env, clazz);
    return result;
  }
  </code></pre>
  
  <p>I thought I can use <code>NULL</code> for the case of any unsuccessful situation such as <code>methodID == NULL</code>.</p>
  
  <p>I think I should use a <code>jobject</code> instead of primitives, right?</p>