title: Is there a Java equivalent of frexp?
body: <p>Is there a Java equivalent of the C / C++ function called <a href="http://www.cplusplus.com/reference/clibrary/cmath/frexp/" rel="noreferrer">frexp</a>?  If you aren't familiar, frexp is <a href="http://en.wikipedia.org/wiki/Math.h#Pre-C99_functions" rel="noreferrer">defined by Wikipedia</a> to "break floating-point number down into mantissa and exponent."</p>
  
  <p>I am looking for an implementation with both speed and accuracy but I would rather have the accuracy if I could only choose one.</p>
  
  <p>This is the code sample from the first reference.  It should make the frexp contract a little more clear:</p>
  
  <pre><code>/* frexp example */
  #include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int main ()
  {
    double param, result;
    int n;
  
    param = 8.0;
    result = frexp (param , &amp;n);
    printf ("%lf * 2^%d = %f\n", result, n, param);
    return 0;
  }
  
  /* Will produce: 0.500000 * 2^4 = 8.000000 */
  </code></pre>