<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC Microcontrollers中的主题 Re: Problem with FPU and double calculation</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565353#M17063</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Wed Oct 15 02:02:54 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you know that the FPU on the LPC43xx is single-precision (float) only. So for anything involving double-precision, the result has to be calculated in software. Therefore any calculation involving a double precision number will be very, very slow compared with a float.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:51:14 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:51:14Z</dc:date>
    <item>
      <title>Problem with FPU and double calculation</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565352#M17062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by h.lotfi on Wed Oct 15 01:22:12 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i have problem with hardware fpu and double calculation!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;when i use float variables and enable FPU and initialize it, i can calculate any things, but when i change variables to double the micro&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;get stick in the line which I calculate double variables and micro could not pass that line!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
 double f=, ff=;
 //float f, ff;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = 0; // init counter
f = 1.000001;// pick initial values that will prevent over/under-runs
ff = 0.999999;
msec = 10000;// run the test for ten seconds
do {
//ff *= f;// test of multiplication
ff =ff/ f;// test of division
count++;
count /= 10;
} while(msec);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but when i add an function micro work correctly!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this code Work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
 double f=, ff=;
 //float f, ff;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = 0; // init counter
f = 1.000001;// pick initial values that will prevent over/under-runs
ff = 0.999999;
msec = 10000;// run the test for ten seconds
do {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sprintf(str,"Num:%d\r\n",count);
//ff *= f;// test of multiplication
ff =ff/ f;// test of division
count++;
count /= 10;
} while(msec);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any body know what its for?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i use LPC4357 and Keil&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:51:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565352#M17062</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FPU and double calculation</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565353#M17063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Wed Oct 15 02:02:54 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you know that the FPU on the LPC43xx is single-precision (float) only. So for anything involving double-precision, the result has to be calculated in software. Therefore any calculation involving a double precision number will be very, very slow compared with a float.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:51:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565353#M17063</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FPU and double calculation</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565354#M17064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by h.lotfi on Wed Oct 15 04:19:36 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;of course i knew!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;my question is,"why when i use double calculating micro stick on that line?"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and "why when i add another function in my loop system work correctly?"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i showed example of this questions in first post.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:51:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565354#M17064</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FPU and double calculation</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565355#M17065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wmues on Wed Oct 15 05:21:46 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume that you do ... while() loop is optimized away by the compiler, because no variable is used outside the loop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The loop is endless? I missed a msec--.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wolfgang&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:51:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565355#M17065</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FPU and double calculation</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565356#M17066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by starblue on Wed Oct 15 06:48:20 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: h.lotfi&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
 double f=, ff=;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;That doesn't look like valid C code, maybe you are confusing several versions of your code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I have this kind of problem I look into the assembly code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:51:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565356#M17066</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with FPU and double calculation</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565357#M17067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by h.lotfi on Sat Oct 18 05:11:55 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;in may main code i write:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
double f=0, ff=0;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you , i will try to understand assembly &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:51:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-FPU-and-double-calculation/m-p/565357#M17067</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:51:16Z</dc:date>
    </item>
  </channel>
</rss>

