<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Printing a float value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86711/printing-a-float-value</link><description>How to print a float value in segger embedded studio? 
 I am using nrf5_sdk17.1.0 version 
 I have used the below statement but it is outputting 0 only always. 
 NRF_LOG_INFO(&amp;quot;sqrtf(VectorDotProduct(pfJ, pfJ)): %d&amp;quot;,sqrtf(VectorDotProduct(pfJ, pfJ)));</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Apr 2022 11:25:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86711/printing-a-float-value" /><item><title>RE: Printing a float value</title><link>https://devzone.nordicsemi.com/thread/362316?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 11:25:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7be4a960-f0c3-4fad-b887-2f09e0d70cf1</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Logging float requires you to use the following dedicated macros:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;a title="Macro for logging error messages. It takes a printf-like, formatted string with up to seven arguments..." href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__log.html#gac8d37e95648e05580513df9aaddf02c3"&gt;NRF_LOG_INFO&lt;/a&gt;(„float value:” &lt;a title="Macro to be used in a formatted string to a pass float number to the log." href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__log.html#ga51024b65418ae9a0e6d79fe285479b9c"&gt;NRF_LOG_FLOAT_MARKER&lt;/a&gt; „\r\n”, &lt;a title="Macro for dissecting a float number into two numbers (integer and residuum)." href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__log.html#ga89b38475decba73ad43184a0e20168cc"&gt;NRF_LOG_FLOAT&lt;/a&gt;(val))&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;For more details you may consult the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.1.0%2Flib_nrf_log.html"&gt;nrf5 documentation regarding logging&lt;/a&gt;&amp;nbsp;on Nordic Semiconductors Infocenter. The specific section containing logging float numbers can be found under &amp;quot;Usage -&amp;gt; Logging&amp;quot;.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I hope this helps!&lt;br /&gt;&lt;br /&gt;Kind regards,&amp;nbsp;&lt;br /&gt;Andreas&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>