user25974: If I store in an array a double-value in this format, in which format I should be able to read the same double out?
double myDouble = 12.123456;
byte myArray[] = {0x00, 0x00, 0x00, 0x00};

myArray[0] = (myDouble >> 0);
myArray[1] = (myDouble >> 8);
myArray[2] = (myDouble >> 16);
myArray[3] = (myDouble >> 24);


user10794: You are better off making a union, that will be compiler independent, and won't give you the (possibly) odd results that trying to shift a double would give.
Example:
  union 
    {
    byte myArray [4];
    double myDouble;
    } foo;


   foo.myArray [0] = Serial.read ();
   foo.myArray [1] = Serial.read ();
   foo.myArray [2] = Serial.read ();
   foo.myArray [3] = Serial.read ();

   double f = foo.myDouble;

Even then be cautious that whatever is sending you this double in 4 bytes is using the same encoding for doubles that the Arduino does. For one thing, double and float are the same on the 8-bit Arduinos (they are only 4 bytes).

25974: <p>If I store in an array a double-value in this format, in which format I should be able to read the same double out?</p>

<pre><code>double myDouble = 12.123456;
byte myArray[] = {0x00, 0x00, 0x00, 0x00};

myArray[0] = (myDouble &gt;&gt; 0);
myArray[1] = (myDouble &gt;&gt; 8);
myArray[2] = (myDouble &gt;&gt; 16);
myArray[3] = (myDouble &gt;&gt; 24);
</code></pre>
 10794: <p>You are better off making a union, that will be compiler independent, and won't give you the (possibly) odd results that trying to shift a double would give.</p>

<p>Example:</p>

<pre><code>  union 
    {
    byte myArray [4];
    double myDouble;
    } foo;


   foo.myArray [0] = Serial.read ();
   foo.myArray [1] = Serial.read ();
   foo.myArray [2] = Serial.read ();
   foo.myArray [3] = Serial.read ();

   double f = foo.myDouble;
</code></pre>

<p>Even then be cautious that whatever is sending you this double in 4 bytes is using the same encoding for doubles that the Arduino does. For one thing, <strong>double</strong> and <strong>float</strong> are the same on the 8-bit Arduinos (they are only 4 bytes).</p>
