<?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: float to char conversion in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/float-to-char-conversion/m-p/179089#M4017</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;This worked, thank you!&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Aug 2008 05:41:24 GMT</pubDate>
    <dc:creator>fongguay</dc:creator>
    <dc:date>2008-08-11T05:41:24Z</dc:date>
    <item>
      <title>float to char conversion</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/float-to-char-conversion/m-p/179087#M4015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm sure that this is a popular question:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How do you convert a 4 byte float into 4 chars?&amp;nbsp; I have tried type casting and doing funny stuff with pointers, but it appears that Code Warrior is saying "I know what you're trying to do, and I won't let you." (I either get an explicit or implicit change of data type error).&amp;nbsp; All I want is the raw float, in bits, in IEEE-754 format, broken into 4 bytes so that I can ship it out one byte at a time.&amp;nbsp; I haven't tried the sprintf deal yet, seems a bit impractical, but if that's what I have to do...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks in advance for any help here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Aug 2008 10:37:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/float-to-char-conversion/m-p/179087#M4015</guid>
      <dc:creator>fongguay</dc:creator>
      <dc:date>2008-08-09T10:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: float to char conversion</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/float-to-char-conversion/m-p/179088#M4016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;I would use a union like this one:&lt;BR /&gt;union {&lt;BR /&gt;&amp;nbsp; float f;&lt;BR /&gt;&amp;nbsp; char c[4];&lt;BR /&gt;} u;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;with u.f = 1.0&amp;nbsp; you store a float, and with u.c[0] etc you can get the indivdual bytes.&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;BlackNight&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Aug 2008 02:19:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/float-to-char-conversion/m-p/179088#M4016</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2008-08-10T02:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: float to char conversion</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/float-to-char-conversion/m-p/179089#M4017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;This worked, thank you!&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2008 05:41:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/float-to-char-conversion/m-p/179089#M4017</guid>
      <dc:creator>fongguay</dc:creator>
      <dc:date>2008-08-11T05:41:24Z</dc:date>
    </item>
  </channel>
</rss>

