user38506: Since a Floating Point Unit (FPU) is not present in Arduino Uno, I wanted to know how float operations are performed. If it is simulated as integer operations, I want to know how exactly the simulation is done.

user359: software emulation. The float is decomposed into sign, exponent and mantissa and then integer operations are used to do the actual math.
Addition and subtraction means shifting the mantissas to a common magnitude, adding/subtracting them and then checking the highest set bit for the new exponent.
Multiplication means adding the exponents and multiplying the mantissas. Division is subtracting.

user7508: As I said in my comment, all float operations are implemented in
software. As a simple test, I compiled the following program:
volatile float x, y, z;

int main(void)
{
    z = x + y;
    return 0;
}

The compiler translated the sum operation into a call to __addsf3.
This function extends its arguments to flt40_t format (non-standard 40
bits float), calls __addsf3x to do the 40-bit addition, then calls
__fp_round to convert the result into the standard float format.
__addsf3x also makes a few library calls of its own. In the end, the
addition pulled the following functions into the compiled program:
__subsf3, __addsf3, __addsf3x, __fp_inf, __fp_nan,
__fp_pscA, __fp_pscB, __fp_round, __fp_split3, __fp_splitA,
__fp_zero and __fp_szero.
All these functions are provided by the avr-libc. You can find them in
the libm/fplib directory. See for example the files:

addsf3.S
addsf3x.S
fp_round.S


38506: <p>Since a Floating Point Unit (FPU) is not present in Arduino Uno, I wanted to know how float operations are performed. If it is simulated as integer operations, I want to know how exactly the simulation is done.</p>
 359: <p>software emulation. The float is decomposed into sign, exponent and mantissa and then integer operations are used to do the actual math.</p>

<p>Addition and subtraction means shifting the mantissas to a common magnitude, adding/subtracting them and then checking the highest set bit for the new exponent.</p>

<p>Multiplication means adding the exponents and multiplying the mantissas. Division is subtracting.</p>
 7508: <p>As I said in my comment, all float operations are implemented in
software. As a simple test, I compiled the following program:</p>

<pre class="lang-c++ prettyprint-override"><code>volatile float x, y, z;

int main(void)
{
    z = x + y;
    return 0;
}
</code></pre>

<p>The compiler translated the sum operation into a call to <code>__addsf3</code>.
This function extends its arguments to <code>flt40_t</code> format (non-standard 40
bits float), calls <code>__addsf3x</code> to do the 40-bit addition, then calls
<code>__fp_round</code> to convert the result into the standard <code>float</code> format.
<code>__addsf3x</code> also makes a few library calls of its own. In the end, the
addition pulled the following functions into the compiled program:
<code>__subsf3</code>, <code>__addsf3</code>, <code>__addsf3x</code>, <code>__fp_inf</code>, <code>__fp_nan</code>,
<code>__fp_pscA</code>, <code>__fp_pscB</code>, <code>__fp_round</code>, <code>__fp_split3</code>, <code>__fp_splitA</code>,
<code>__fp_zero</code> and <code>__fp_szero</code>.</p>

<p>All these functions are provided by the avr-libc. You can find them in
the <a href="http://svn.savannah.gnu.org/viewvc/avr-libc/trunk/avr-libc/libm/fplib/" rel="nofollow noreferrer">libm/fplib directory</a>. See for example the files:</p>

<ul>
<li><a href="http://svn.savannah.gnu.org/viewvc/avr-libc/trunk/avr-libc/libm/fplib/addsf3.S?revision=2473&amp;view=markup" rel="nofollow noreferrer">addsf3.S</a></li>
<li><a href="http://svn.savannah.gnu.org/viewvc/avr-libc/trunk/avr-libc/libm/fplib/addsf3x.S?revision=2473&amp;view=markup" rel="nofollow noreferrer">addsf3x.S</a></li>
<li><a href="http://svn.savannah.gnu.org/viewvc/avr-libc/trunk/avr-libc/libm/fplib/fp_round.S?revision=2191&amp;view=markup" rel="nofollow noreferrer">fp_round.S</a></li>
</ul>
