title: NSDecimal equal to NSDecimalNumber value?
body: <p>I am looking for an effective way to save <code>NSDecimalNumber</code> with other data in <code>NSData</code> buffer.</p>
  
  <p>I have not found a method to do it directly from <code>NSDecimalNumber</code>.
  However, it is easy to convert it with :</p>
  
  <pre><code>NSDecimal value = [theDecimalNumber decimalValue];
  </code></pre>
  
  <p>And it is not difficult to transfer <code>NSDecimal</code> in memory (20 bytes).</p>
  
  <p>But, my question: <strong>The <code>NSDecimalNumber</code> and <code>NSDecimal</code> values are they exactly the same?</strong></p>
  
  <p>Because their declarations have some differences (<code>ExternalRefCount</code> ?):</p>
  
  <pre><code>@interface NSDecimalNumber : NSNumber {
  @private
      signed   int _exponent:8;
      unsigned int _length:4;
      unsigned int _isNegative:1;
      unsigned int _isCompact:1;
      unsigned int _reserved:1;
      unsigned int _hasExternalRefCount:1;
      unsigned int _refs:16;
      unsigned short _mantissa[0]; /* GCC */
  }
  
  typedef struct {
      signed   int _exponent:8;
      unsigned int _length:4;     // length == 0 &amp;&amp; isNegative -&gt; NaN
      unsigned int _isNegative:1;
      unsigned int _isCompact:1;
      unsigned int _reserved:18;
      unsigned short _mantissa[NSDecimalMaxSize];
  } NSDecimal;
  </code></pre>
  
  <p>Is it possible to perform many transfers between the two type, without any loss of precision ?</p>