Floating point format

What's the binary format for the floating point data type?

IEEE754 - Single-precision floating-point format - Wikipedia -

robtillaart:
IEEE754 - Single-precision floating-point format - Wikipedia -

I assume it's big endian on the byte order?

Arduino is little endian. The float and double types are both 32-bit IEEE floating point.

fat16lib:
Arduino is little endian. The float and double types are both 32-bit IEEE floating point.

Thanks -- somehow I got it in my head it was a big endian environment.

I figure you have to know the answer to this one, since you seem to be the resident font of all knowledge -- how many flops for an average mix of add, subtract, multiply and divide? Anyone ever bench mark the floating point, or is the answer "don't do it."?

floating points are expensive (time & footprint) as there is no dedicated hardware for it.

A simple timing sketch with 10000 add (etc) will give you the numbers, snippet code see below

volatile float a = 3.14; // volatile prevents compiler optimize
volatile float b = 2.78;
volatile float c = 0;
unsigned long before = millis();
for (int i=0; i< 1000; i++)
{
   c = a * b;
}
Serial.println( miliis() - before);

That would require me to have a spare Arduino to benchmark. The one and only Uno I have at the moment is currently doing Modbus longevity testing. I have some MAX485 chips coming to town and will have a proper RS-485 Uno just in time for the handful of Mini's I ordered to arrive. THEN benchmarking.

OK,

but recall that in the range -2^31 .. 2^31 (~~2.000.000.000) longs are much faster, and most math that only do math in this range is convertable from float to long. Even if you need e.g. 3 decimals you can do it in long and divide by 1000.0 at the last moment.