<?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>float</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/31000/float</link><description>strange float question !</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Mar 2018 01:11:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/31000/float" /><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122529?ContentTypeID=1</link><pubDate>Fri, 02 Mar 2018 01:11:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a89aa112-5969-4e4c-be53-82d9b54026c6</guid><dc:creator>strengthstrong</dc:creator><description>&lt;p&gt;This is the code and terminal output, this function p_hsb_h start is 0.00, f = 0.00 is correct, in theory 1-f should be equal to 1.00, but the terminal output is 0.00, is not it a strange question&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122528?ContentTypeID=1</link><pubDate>Fri, 02 Mar 2018 01:07:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b469e5f3-d515-407f-9ce0-46c6f539a367</guid><dc:creator>strengthstrong</dc:creator><description>&lt;p style="padding-left:30px;"&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/9U4_5D00_LXH_5B00_E_40002500_J1AJ9C_7E00_ZQDDY.png" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/VR_2900_V_5D007E00400025007D00_D_7B007D00_TN_4000_R_7D00_9_28005B00_V4U.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122433?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 10:44:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1baf90b-3e2b-490b-9b9d-3ccbddb5e464</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;that is not the code which produces the output you are asking about.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Anyway if you are having a problem printing floats do what I suggested and go find posts about printing floats because it&amp;#39;s more than likely in the real code, which you haven&amp;#39;t posted, you&amp;#39;re using a logging method which doesn&amp;#39;t log floats and just prints 0.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122426?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 10:24:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26d91d44-5bd4-4b64-b6f2-01c720fa8f1c</guid><dc:creator>strengthstrong</dc:creator><description>&lt;p&gt;This is my program code, with NRF_LOG_INFO print, I would like to know what is the reason leading to 1-f = 0.0, you see, log print out f = 0.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122425?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 10:20:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9de1a2b5-9116-4c98-97da-cce2a7c3aff0</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;What on earth are&amp;nbsp; you asking here? Would you post a proper question please. The code you&amp;#39;ve posted has nothing to do with the output at the top, nothing at all.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Post the code which generates that output, in full, and write more than 2 words of question about what it is you want to know.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And check the dev forums for hints about how to output floats, many of the printf() type functions don&amp;#39;t actually support floats and just print 0.&lt;/p&gt;
&lt;p&gt;And instead of using printf() debugging, use a debugger and LOOK at the numbers.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122421?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 10:16:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8195940-8a4a-49c2-aca1-79e948234e41</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;This is not the code that produced the terminal output in the original post.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122419?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 10:12:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b94134a2-76a9-41c4-95ff-5a38dcd24fd1</guid><dc:creator>strengthstrong</dc:creator><description>&lt;p&gt;With this relationship should be&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122418?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 10:12:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3def5bb-2452-4b16-add5-f754fdd7c647</guid><dc:creator>strengthstrong</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;float r = 0, g = 0, b = 0; 
int i = (int) fmod((p_hsb_h / 60), 6);
NRF_LOG_RAW_INFO(&amp;quot;i= %d\r\n&amp;quot;,i);
float f = (p_hsb_h / 60) - i;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122417?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 10:11:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:daa1c254-ec7a-4a35-aa5b-1a18125c79f2</guid><dc:creator>strengthstrong</dc:creator><description>&lt;p&gt;float r = 0, g = 0, b = 0; &lt;br /&gt; int i = (int) fmod((p_hsb_h / 60), 6);&lt;br /&gt; NRF_LOG_RAW_INFO(&amp;quot;i= %d\r\n&amp;quot;,i);&lt;br /&gt; float f = (p_hsb_h / 60) - i;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122415?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 10:08:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a2b1661-8962-40b1-8379-67a5d34ac626</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hey strengthstrong,&lt;/p&gt;
&lt;p&gt;Do you mind sharing relevant code? We need more information.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: float</title><link>https://devzone.nordicsemi.com/thread/122407?ContentTypeID=1</link><pubDate>Thu, 01 Mar 2018 09:52:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cefc4253-3749-4d72-bbd1-8c2df2415730</guid><dc:creator>strengthstrong</dc:creator><description>&lt;p&gt;why 1-f =0.00&lt;/p&gt;
&lt;p&gt;what lead to it ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>