ESP8266 Developer Zone The Official ESP8266 Forum 2020-12-17T17:40:48+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=67477 2020-12-17T17:40:48+08:00 2020-12-17T17:40:48+08:00 https://bbs.espressif.com:443/viewtopic.php?t=67477&p=98251#p98251 <![CDATA[Re: ESP8266_RTOS_SDK How do you printf floats?]]> Make Menuconfig->Components Config->Newlib->Change newLib value level to float nano.

Statistics: Posted by Gowtham — Thu Dec 17, 2020 5:40 pm


]]>
2020-11-21T06:07:56+08:00 2020-11-21T06:07:56+08:00 https://bbs.espressif.com:443/viewtopic.php?t=67477&p=91786#p91786 <![CDATA[ESP8266_RTOS_SDK How do you printf floats?]]>
Trying to print floats using printf, e.g.,

float d = 1.0;
printf("d = %f", d);

But it prints out:
d =

Also sprintf doesn' work with floating point numbers;

My assumption is that the floating point is not enabled in the compiler? If that is the case, I'm not sure what the flag is to enable?


Version of compiler:
xtensa-lx106-elf-gcc --version
xtensa-lx106-elf-gcc (crosstool-NG esp-2020r3-49-gd5524c1) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks,

Andy ...

Statistics: Posted by ajs — Sat Nov 21, 2020 6:07 am


]]>