<?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>CodeWarrior for MCUのトピックRe: Weird results using floating point</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210936#M8307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I did some tests with CodeWarrior for HC12 V4.7.&lt;/DIV&gt;&lt;DIV&gt;The code is returning the appropriate result.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I would suggest you to create a new project using the project wizard.&lt;/DIV&gt;&lt;DIV&gt;Specify from the beginning you want to use 64-bit for double encoding and large memory model and then plug your code in there.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This should be working.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Dec 2008 18:54:11 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2008-12-18T18:54:11Z</dc:date>
    <item>
      <title>Weird results using floating point</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210933#M8304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear All&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to run a couple of floating point operations and simply cannot get it working. Here is the simplest code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;float temp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;temp = 23/3.5;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After this instruction, the value of temp is 18724.582131&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using CW 5.0.14.8093 for an HCS12NE64 microcontroller. I am using ansilf.lib.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would anyone help me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Deneb&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2008 01:10:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210933#M8304</guid>
      <dc:creator>deneb</dc:creator>
      <dc:date>2008-12-18T01:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Weird results using floating point</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210934#M8305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Single precision float, of value 23/3.5 = ~6.5714285, read from memory&amp;nbsp;as double, with any value of the second long word, is about &amp;nbsp;18724.5 .&lt;/DIV&gt;&lt;DIV&gt;I don't know what happens in your case, but it could be something like project settings (double and float sizes ) are incompatible with the libraries you are using.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2008 17:26:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210934#M8305</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2008-12-18T17:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Weird results using floating point</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210935#M8306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks kef. I figured it out by following the information in {CodeWarrior for HCS12 V4.7\lib\hc12c\readme.txt} file. It was some settings issue, as you mentioned, for the assembler. The following settings worked with ansil.lib file.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;-D_HCS12 -Ml&amp;nbsp; -W2 -Os -F2 -NoPath&lt;BR /&gt;&lt;BR /&gt;However, I still cannot get ansilf.lib to work. I need it to use IEEE64 double values. Even when I put "-Cf", it gives the wrong results, which as I understand, is swapping the higher two bytes with the lower two bytes. Is it a bug?&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2008 17:38:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210935#M8306</guid>
      <dc:creator>deneb</dc:creator>
      <dc:date>2008-12-18T17:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Weird results using floating point</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210936#M8307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I did some tests with CodeWarrior for HC12 V4.7.&lt;/DIV&gt;&lt;DIV&gt;The code is returning the appropriate result.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I would suggest you to create a new project using the project wizard.&lt;/DIV&gt;&lt;DIV&gt;Specify from the beginning you want to use 64-bit for double encoding and large memory model and then plug your code in there.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This should be working.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2008 18:54:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210936#M8307</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2008-12-18T18:54:11Z</dc:date>
    </item>
    <item>
      <title>SOLVED:  Weird results using floating point</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210937#M8308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello CrasyCat&lt;BR /&gt;&lt;BR /&gt;Creating an empty project and setting appropriate options in the wizard dialogs did the trick.&lt;BR /&gt;&lt;BR /&gt;Thanks to everybody&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 20:59:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Weird-results-using-floating-point/m-p/210937#M8308</guid>
      <dc:creator>deneb</dc:creator>
      <dc:date>2008-12-19T20:59:37Z</dc:date>
    </item>
  </channel>
</rss>

