Q:

How does an AVR perform floating point Arithmetic

I'm trying to implement a support for double and float and corresponding basic arithmetic on a CPU without an FPU.
I know that it is possible on all AVR ATmega controllers. An ATmega also has no FPU. So here comes the question: How does it work? If there any suggestions for literature or links with explanations and examples?
At the best case I will provide a support for code like this:
double twice ( double x )
{
  return x*x;
}

Many thanks in advance,
Alex

A:

This post may be interesting for you: Floating point calculations in a processor with no FPU
As stated:

Your compiler may provide support, or you may need to roll your own.
  There are freely-available implementations, too.

If it's for an ATmega, you probably don't have to write anything yourself. All the already available libraries are probably already optimized much further than you possible can do yourself. If you need more performance, you could consider to convert the floating points to fixed points. You should consider this anyway. If you can get the job done in fixed point, you should stay away from floating point.

A:

Here are AVR related links with explanations and examples for implementing soft double:

You will find one double floating point lib here.
Another one can be found it in the last message here.
Double is very slow, so if speed is in concern, you might opt for fixed point math. Just read my messages in this thread:

