<?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>8-bit MicrocontrollersのトピックRe: X^Y without pow(x,y)</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278775#M20267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to run&lt;/P&gt;&lt;P&gt;val =x;&lt;/P&gt;&lt;P&gt;for(i =0; i &amp;lt; y ; i++) { val = x * val}&lt;/P&gt;&lt;P&gt;your answer is val&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jun 2013 12:53:42 GMT</pubDate>
    <dc:creator>johnturnur</dc:creator>
    <dc:date>2013-06-06T12:53:42Z</dc:date>
    <item>
      <title>X^Y without pow(x,y)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278774#M20266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello everybody,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know to calculate x^y without the pow(x,y) function?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answers&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alexis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 12:49:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278774#M20266</guid>
      <dc:creator>alexismercier</dc:creator>
      <dc:date>2013-06-06T12:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: X^Y without pow(x,y)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278775#M20267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to run&lt;/P&gt;&lt;P&gt;val =x;&lt;/P&gt;&lt;P&gt;for(i =0; i &amp;lt; y ; i++) { val = x * val}&lt;/P&gt;&lt;P&gt;your answer is val&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 12:53:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278775#M20267</guid>
      <dc:creator>johnturnur</dc:creator>
      <dc:date>2013-06-06T12:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: X^Y without pow(x,y)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278776#M20268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;John Turnur wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;You need to run&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;val = x;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;for(i =0; i &amp;lt; y ; i++) { val = x * val}&lt;/P&gt;
&lt;P&gt;your answer is val&lt;/P&gt;
 &lt;/BLOCKQUOTE&gt;&lt;P&gt;The initialisation for val should be &lt;SPAN style="font-family: courier new,courier;"&gt;val = 1;&lt;/SPAN&gt;&lt;BR /&gt;For this simple method, y must be an integer value, and with this implementation, the value of y must be positive and non-zero. To handle y = 0, use a "while" loop, rather than a "for" loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;val = 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;while (y) { val *= x; y--; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;If x is an integer value, overflow can easily occur, so checking for this condition might be desireable.&amp;nbsp; Overflow would be less of a problem if x is a floating point value.&amp;nbsp; It should also be possible to accurately handle negative values of y.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;val = 1.0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if (y &amp;gt;= 0) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; while (y) { val *= x; y--; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;else {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; while (y) { val /= x; y++; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Mac&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 17:20:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278776#M20268</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2013-06-06T17:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: X^Y without pow(x,y)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278777#M20269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot i'll try this tommorow&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Alexis&lt;/P&gt;&lt;P&gt;Le 6 juin 2013 14:53, "John Turnur" &amp;lt;admin@community.freescale.com&amp;gt; a&lt;/P&gt;&lt;P&gt;écrit :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;P&gt;**&lt;/P&gt;&lt;P&gt;     &lt;A href="image: Freescale Community"&gt;image: Freescale Community&lt;/A&gt;&amp;lt;https://community.freescale.com/index.jspa&amp;gt;  X^Y without pow(x,y) created by John&lt;/P&gt;&lt;P&gt;Turnur &amp;lt;https://community.freescale.com/people/johnturnur&amp;gt; in *8-bit&lt;/P&gt;&lt;P&gt;Microcontrollers* - View the full discussion&amp;lt;https://community.freescale.com/message/333430#333430&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 17:28:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278777#M20269</guid>
      <dc:creator>alexismercier</dc:creator>
      <dc:date>2013-06-06T17:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: X^Y without pow(x,y)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278778#M20270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alexis, how did it go? &lt;/P&gt;&lt;P&gt;Did you get to try any of those out?&lt;/P&gt;&lt;P&gt;We'd like to know :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing, regards!&lt;/P&gt;&lt;P&gt;Monica.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 00:15:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278778#M20270</guid>
      <dc:creator>Monica</dc:creator>
      <dc:date>2013-06-13T00:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: X^Y without pow(x,y)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278779#M20271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Monica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't have enought time to try this function because I've also lot of work on the clock (DS1307 if you have any information abou this you're welcome :smileywink:) .I'll keep you informed as soon as possible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Alexis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 08:17:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278779#M20271</guid>
      <dc:creator>alexismercier</dc:creator>
      <dc:date>2013-06-13T08:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: X^Y without pow(x,y)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278780#M20272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;sorry for the delay .&lt;/P&gt;&lt;P&gt;in my program i want to divide a number into several digits so this method didn't work .&lt;/P&gt;&lt;P&gt;i used this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; valeur = nombre;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(i==0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; digit1 = nombre/1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; nombre=valeur-(digit1*1000);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; digit2=nombre/100;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; //if (Flash_Program(address,carac)){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; //}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; nombre =valeur-(digit1*1000+(digit2*100));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; digit3=nombre/10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; //if (Flash_Program(address,carac)){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; //}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; nombre=valeur- (digit1*1000+(digit2*100+(digit3*10))) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i==3){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; digit4=nombre;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your help&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Alexis MERCIER&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 14:39:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/X-Y-without-pow-x-y/m-p/278780#M20272</guid>
      <dc:creator>alexismercier</dc:creator>
      <dc:date>2013-07-16T14:39:53Z</dc:date>
    </item>
  </channel>
</rss>

