:roll_eyes:

The ATtiny does not have a floating point unit to perform calculations, the ATmegas do not have one, either, but you may nevertheless use floating point math,. It will be done in software, but it is 1. slow 2. uses some amount of RAM 3. uses some amount of flash memory

There is almost always a way to avoid floating point math and use integer math instead. More information about your project is needed to help you further

olimex: :roll_eyes:

In hardware?

No. And neither does the Mega328.

In software? Yes.

"float" variables will work, though don't expect to do a lot of number crunching.

"double" variables will be treated as floats.

This really shocks me.

I am following a course about Computer Architecture at the University and I learned that the floating math isn't on all processors, especially embedded ones. Later I thought about the Magwick and the PI filter I am writing for my quadcopter and I figured out it is ALL floating point math. At that point I though the ATMega 328 MUST have floating point math to do that, and what about the smallest of the family, the ATTiny85?

But now... Boh! Ok! All software emulation magic, I got it :astonished:

At this point my question is: what Arduino boards have a proper floating point ALU? And what about the Teensy? The RaspberryPi?

Thank you

olimex: I am following a course about Computer Architecture at the University and I learned that the floating math isn't on all processors, especially embedded ones. Later I thought about the Magwick and the PI filter I am writing for my quadcopter and I figured out it is ALL floating point math. At that point I though the ATMega 328 MUST have floating point math to do that, and what about the smallest of the family, the ATTiny85?

But now... Boh! Ok! All software emulation magic, I got it :astonished:

This page tells you how many clock cycles the various functions take:

http://www.nongnu.org/avr-libc/user-manual/benchmarks.html

nb. **addsf3/**mulsf3/__divsf3 are the internal functions that add/multiply/divide.

There **is** a difference between ATmega ("AVR4") and ATtiny ("AVR2") because the ATmega has a few more instructions, including an instruction to multiply two bytes (in hardware, 2 clock cycles).

olimex: At this point my question is: what Arduino boards have a proper floating point ALU? And what about the Teensy? The RaspberryPi?

You're a University-level student? Do the research...

Ahaha ok! I will post here my reseults ;)

Teensy3.x and Tiva launchpad (energia) are the only arduino boards I can think of that have HW support for floating point. (cortex m4f). I think it's only single precision fp, so I'm not sure that the compiler uses it all of the time.

The Teensy 3.x use an ARM Cortex M4 which has DSP instructions but they do not have floating point.

Pete

I found that the following boards have floating point hardware support:

The Arduino TRE Sitara AM3359 Raspberry Pi ARM11