cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3, IAR6.4 how to printf() floating point?

evgeny_sazhaev
Associate
Posted on November 23, 2012 at 05:08

Or, in general, how to printf() numbers with decimal point?

Thanks

#floating-point---just-say-no
2 REPLIES 2
Posted on November 23, 2012 at 05:37

Pretty much the same as any other C compiler. With IAR you'd need to link against a suitable library with the level of support you need.

''Choosing formatters for printf and scanf'' might be worth a review

http://supp.iar.com/FilesPublic/UPDINFO/004916/arm/doc/EWARM_DevelopmentGuide.ENU.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III
Posted on November 23, 2012 at 09:54

''With IAR you'd need to link against a suitable library with the level of support you need''

And similarly for other embedded toolsets.

Using floating-point brings very large burdens in terms of execution speed and code size - which is why most embedded toolsets will not enable floating-point support unless you specifically request it.

Many (most?) calculations in embedded systems can be done perfectly well - and at vastly reduced overhead - with integer arithmetic and a little thought. Or, perhaps, with fixed-point.

So a more fundamental question migth be: why do you feel the need for floating point...?