<?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 Can not use the function „strtod“ in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Can-not-use-the-function-strtod/m-p/168449#M1753</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to translate numbers from string to double. Therefor I would like to use the function “strtod(char *x, char **y)”&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I test this with following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;double&amp;nbsp;&amp;nbsp; result&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0;&lt;/P&gt;&lt;P&gt;char&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *sub_str_end&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = NULL;&lt;/P&gt;&lt;P&gt;char test[] = "1.234";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//! Test 1&lt;/P&gt;&lt;P&gt;result = strtod(test, NULL);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//! Test 1&lt;/P&gt;&lt;P&gt;sub_str_end = test+4;&lt;/P&gt;&lt;P&gt;result = strtod(test, &amp;amp;sub_str_end);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (errno != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("ERRNO\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I use this code, I get the number “-927712936.000000” for result.&lt;/P&gt;&lt;P&gt;Does anyone has an idea why this not work? (Are there missing compiler settings?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jun 2012 17:07:27 GMT</pubDate>
    <dc:creator>soli</dc:creator>
    <dc:date>2012-06-01T17:07:27Z</dc:date>
    <item>
      <title>Can not use the function „strtod“</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Can-not-use-the-function-strtod/m-p/168449#M1753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to translate numbers from string to double. Therefor I would like to use the function “strtod(char *x, char **y)”&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I test this with following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;double&amp;nbsp;&amp;nbsp; result&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0;&lt;/P&gt;&lt;P&gt;char&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *sub_str_end&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = NULL;&lt;/P&gt;&lt;P&gt;char test[] = "1.234";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//! Test 1&lt;/P&gt;&lt;P&gt;result = strtod(test, NULL);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//! Test 1&lt;/P&gt;&lt;P&gt;sub_str_end = test+4;&lt;/P&gt;&lt;P&gt;result = strtod(test, &amp;amp;sub_str_end);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (errno != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("ERRNO\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I use this code, I get the number “-927712936.000000” for result.&lt;/P&gt;&lt;P&gt;Does anyone has an idea why this not work? (Are there missing compiler settings?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2012 17:07:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Can-not-use-the-function-strtod/m-p/168449#M1753</guid>
      <dc:creator>soli</dc:creator>
      <dc:date>2012-06-01T17:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can not use the function „strtod“</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Can-not-use-the-function-strtod/m-p/168450#M1754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello soli,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your program uses compilers strtod, you haven't specified which one, if it was for CW,IAR or KEIL.&lt;/P&gt;&lt;P&gt;Anyway, MQX provides its function called _io_strtod which is located in a file io_fp.c in the directory source/fio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try _io_strtod and share with us if it works for your case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MartinK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2012 13:53:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Can-not-use-the-function-strtod/m-p/168450#M1754</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2012-06-05T13:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can not use the function „strtod“</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Can-not-use-the-function-strtod/m-p/168451#M1755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Kojto,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_io_strtod is working well. (I use CW)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I do not understand why the normal strtod does not work? Because it is a normal standard function in C.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2012 16:58:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Can-not-use-the-function-strtod/m-p/168451#M1755</guid>
      <dc:creator>soli</dc:creator>
      <dc:date>2012-06-08T16:58:41Z</dc:date>
    </item>
  </channel>
</rss>

