<?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>Strange behavior when division operation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49735/strange-behavior-when-division-operation</link><description>Hi, 
 
 I am using nRF52832, SDK_15.3.0, S132 SoftDevice and Segger for flashing the image. I am using ‘ble_app_blinky’. 
 As shown in below snapshot I am just doing below operation. How come 247 divide by 10 becomes 0. Some thing strange going. 
 
 i16CheckTempThresholds</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 13 Jul 2019 05:44:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49735/strange-behavior-when-division-operation" /><item><title>RE: Strange behavior when division operation</title><link>https://devzone.nordicsemi.com/thread/198258?ContentTypeID=1</link><pubDate>Sat, 13 Jul 2019 05:44:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6692ba6-d059-4a93-ace4-840fb1775d39</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Ya, Code is optimized. When I keep in Debug mode I am seeing properly. Just to cross check, I kept back in Release mode and printed the variables and I am seeing as expected.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your inputs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Strange behavior when division operation</title><link>https://devzone.nordicsemi.com/thread/198257?ContentTypeID=1</link><pubDate>Fri, 12 Jul 2019 12:57:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb13ea6a-c022-4c62-8758-987a6c94be76</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;Vishnu&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;Do you see the same without code optimization? It can be a bit tricky to correctly debug the code when you have optimization enabled (e.g, variables being placed directly in CPU registers,etc)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>