user12146: It looks like on ATMega based boards, float and double are equivalent 32-bit (4-byte) data types.
However, on the Arduino Due, doubles are 64-bit (8-byte) where floats are 32-bit (4-byte), same as the ATMega boards.
I also saw one source on avr-gcc that listed double as non-standard.
So, when writing code for ATMega based boards are floats preferable to using doubles, since that would make the code equivalent for Due boards? Or are doubles preferable for any reason?

user4143: Neither are preferable.
Unless your microcontroller has a hardware floating point unit using float or double results in huge overheads for your program.
So instead use integer mathematics whenever possible.
Instead of working in Volts, work in millivolts, for example.
However, if your MCU does have an FPU, and some modern more powerful ones do, then you should use the size of float or double that is native to the FPU. If it is a 32 bit FPU then use float. If it is a 64 bit FPU then you can use double.

user10794: See avr-gcc

Deviations from the Standard
double
double is only 32 bits wide and implemented in the same way as float



when writing code for ATMega based boards ...

They are the same, therefore.

(Edited to add)

When writing code, is it then preferable to using one over the other?

I don't really understand your question. You asked about writing code for the ATMega based boards. Do you really mean, if you are writing code for the Due? The quick answer would be, on the Due, double takes twice the RAM, however it is over twice as precise - around 7.2 decimal digits for float compared to 15.9 for double. (I'm not sure about the speed, probably double would be slower, unless it is implemented in floating-point hardware - however I cannot see any reference to that on the AT91SAM3X8E datasheet).
See: https://en.wikipedia.org/wiki/Floating_point
If you want more precision (however slower and taking more RAM) then you could use double - which won't make any difference on the ATmega based boards, but will on the Due.

As Edgar Bonet said:

I would use float so that anyone reading my code, who may not know about the non-standard AVR double, knows what precision to expect.

That makes quite a bit of sense.

I warn you though that "preferable" is subjective. It is close to asking "what is best"? To which the reply is: "best for what?"

12146: <p>It looks like on ATMega based boards, <code>float</code> and <code>double</code> are equivalent 32-bit (4-byte) data types.</p>

<p>However, on the Arduino Due, <code>doubles</code> are 64-bit (8-byte) where <code>floats</code> are 32-bit (4-byte), same as the ATMega boards.</p>

<p>I also saw one source on avr-gcc that listed <code>double</code> as non-standard.</p>

<p>So, when writing code for ATMega based boards are <code>floats</code> preferable to using <code>doubles</code>, since that would make the code equivalent for Due boards? Or are <code>doubles</code> preferable for any reason?</p>
 4143: <p>Neither are preferable.</p>

<p>Unless your microcontroller has a hardware floating point unit using float or double results in huge overheads for your program.</p>

<p>So instead use integer mathematics whenever possible.</p>

<p>Instead of working in Volts, work in millivolts, for example.</p>

<p>However, if your MCU does have an FPU, and some modern more powerful ones do, then you should use the size of float or double that is native to the FPU. If it is a 32 bit FPU then use float. If it is a 64 bit FPU then you can use double.</p>
 10794: <p>See <a href="https://gcc.gnu.org/wiki/avr-gcc" rel="nofollow">avr-gcc</a></p>

<blockquote>
  <p>Deviations from the Standard</p>
  
  <p><strong>double</strong></p>
  
  <p>double is only 32 bits wide and implemented in the same way as float</p>
</blockquote>

<hr>

<blockquote>
  <p>when writing code for ATMega based boards ...</p>
</blockquote>

<p>They are the same, therefore.</p>

<hr>

<p><em>(Edited to add)</em></p>

<blockquote>
  <p>When writing code, is it then preferable to using one over the other?</p>
</blockquote>

<p>I don't really understand your question. You asked about writing code for the ATMega based boards. Do you really mean, if you are writing code for the Due? The quick answer would be, on the Due, double takes twice the RAM, however it is over twice as precise - around 7.2 decimal digits for float compared to 15.9 for double. (I'm not sure about the speed, probably double would be slower, unless it is implemented in floating-point hardware - however I cannot see any reference to that on the AT91SAM3X8E datasheet).</p>

<p>See: <a href="https://en.wikipedia.org/wiki/Floating_point" rel="nofollow">https://en.wikipedia.org/wiki/Floating_point</a></p>

<p>If you want more precision (however slower and taking more RAM) then you could use <code>double</code> - which won't make any difference on the ATmega based boards, but will on the Due.</p>

<hr>

<p>As Edgar Bonet said:</p>

<blockquote>
  <p>I would use float so that anyone reading my code, who may not know about the non-standard AVR double, knows what precision to expect.</p>
</blockquote>

<p>That makes quite a bit of sense.</p>

<hr>

<p>I warn you though that "preferable" is subjective. It is close to asking "what is best"? To which the reply is: "best for what?"</p>
