Arduino Forum

Products => MKR Boards => MKRZero => Topic started by: JesterJ on Feb 13, 2018, 10:32 pm

Title: sprintf does not work with float
Post by: JesterJ on Feb 13, 2018, 10:32 pm
sprintf does not work with float

This seems to be a long standing problem with Arduino "C"

Numerous functions to act as a substitute can be found via a google search for this, however none of them seems to work either correctly or at all.

Does anyone know of a functional (preferably clean) solution?

If you have used something that works, an example would also be helpful.

Title: Re: sprintf does not work with float
Post by: sandeepmistry on Feb 14, 2018, 09:38 pm
Add this above setup

Code: [Select]

asm(".global _printf_float");
asm(".global _scanf_float");


It will force the compiler to link floating point support for printf and scanf.