<?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>topic Re: long int to float in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249144#M19807</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We can use type cast to convert long int to float. For example:&lt;/P&gt;&lt;P&gt; volatile long int l_val=5;&lt;/P&gt;&lt;P&gt; volatile float f_result,f_val=1.23;&lt;/P&gt;&lt;P&gt; f_result=(float)l_val/f_val;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In above code " l_val " computes as float.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Feb 2013 22:19:47 GMT</pubDate>
    <dc:creator>juancarlossuare</dc:creator>
    <dc:date>2013-02-14T22:19:47Z</dc:date>
    <item>
      <title>long int to float</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249143#M19806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;¿How to convert from long int to float?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 03:52:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249143#M19806</guid>
      <dc:creator>juancarlossuare</dc:creator>
      <dc:date>2013-02-06T03:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: long int to float</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249144#M19807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We can use type cast to convert long int to float. For example:&lt;/P&gt;&lt;P&gt; volatile long int l_val=5;&lt;/P&gt;&lt;P&gt; volatile float f_result,f_val=1.23;&lt;/P&gt;&lt;P&gt; f_result=(float)l_val/f_val;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In above code " l_val " computes as float.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 22:19:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249144#M19807</guid>
      <dc:creator>juancarlossuare</dc:creator>
      <dc:date>2013-02-14T22:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: long int to float</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249145#M19808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might want to see if you get approximately the correct value when I_val is initialised with a value that exceeds the 16-bit&amp;nbsp; numeric range, e.g. long int I_val = 123456L;&amp;nbsp; Of course, the conversion to float will usually result in some loss of precision, maybe with accuracy limited to about 5 digits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 09:44:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249145#M19808</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2013-02-15T09:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: long int to float</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249146#M19809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;conversion from int to float is exact provided integer can fit FP mantissa. For single precision float, with its 24bit mantissa, no precision is lost converting long int's in the range -16777215 to +16777215.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 09:59:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249146#M19809</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2013-02-15T09:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: long int to float</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249147#M19810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Juan, I invite you to mark the best answer as correct, this way other people experiencing the same problem can identify the solution.&lt;/P&gt;&lt;P&gt;If the answers here have not helped, let us know! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 16:07:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249147#M19810</guid>
      <dc:creator>Monica</dc:creator>
      <dc:date>2013-02-18T16:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: long int to float</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249148#M19811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Monica.&lt;/P&gt;&lt;P&gt;This answer was given in a service request of freescale.&lt;/P&gt;&lt;P&gt;We can use type cast to convert long int to float. For example:&lt;/P&gt;&lt;P&gt; volatile long int l_val=5;&lt;/P&gt;&lt;P&gt; volatile float f_result,f_val=1.23;&lt;/P&gt;&lt;P&gt; f_result=(float)l_val/f_val;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In above code " l_val " computes as float.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2013 23:06:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/long-int-to-float/m-p/249148#M19811</guid>
      <dc:creator>juancarlossuare</dc:creator>
      <dc:date>2013-02-18T23:06:34Z</dc:date>
    </item>
  </channel>
</rss>

