<?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: problems with sqrt() function</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/problems-with-sqrt-function/m-p/160719#M4409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;To compute the square, multiply it with itself,&lt;BR /&gt;dist_3^2 does toggle the second last bit :smileyhappy:.&lt;BR /&gt;So try dist_3*dist_3 instead.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 31 May 2008 05:10:12 GMT</pubDate>
    <dc:creator>CompilerGuru</dc:creator>
    <dc:date>2008-05-31T05:10:12Z</dc:date>
    <item>
      <title>problems with sqrt() function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/problems-with-sqrt-function/m-p/160717#M4407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I am trying to do the following calculation&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; location[3] = isqrt((dist_3^2)-((location[1])^2)-(location[2])^2);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and I get&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Error C1826: Integer-expression expected&lt;/DIV&gt;&lt;DIV&gt;Error C5002: Illegal type&lt;/DIV&gt;&lt;DIV&gt;Error C1829: +- Incompatible types&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;among others.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;"location" is a double, and "dist_3" is an int.&lt;/DIV&gt;&lt;DIV&gt;I put a line, #include "math.h" at the top of my code...&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 May 2008 01:02:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/problems-with-sqrt-function/m-p/160717#M4407</guid>
      <dc:creator>Franklin</dc:creator>
      <dc:date>2008-05-31T01:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: problems with sqrt() function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/problems-with-sqrt-function/m-p/160718#M4408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;HR /&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; location[3] = isqrt((dist_3^2)-((location[1])&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;^&lt;/FONT&gt;&lt;/STRONG&gt;2)-(location[2])&lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;^&lt;/STRONG&gt;&lt;/FONT&gt;2);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;XORing with double is something :smileyhappy:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by kef on &lt;SPAN class="date_text"&gt;2008-05-30&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;11:51 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 May 2008 03:50:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/problems-with-sqrt-function/m-p/160718#M4408</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2008-05-31T03:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: problems with sqrt() function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/problems-with-sqrt-function/m-p/160719#M4409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;To compute the square, multiply it with itself,&lt;BR /&gt;dist_3^2 does toggle the second last bit :smileyhappy:.&lt;BR /&gt;So try dist_3*dist_3 instead.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 May 2008 05:10:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/problems-with-sqrt-function/m-p/160719#M4409</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2008-05-31T05:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: problems with sqrt() function</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/problems-with-sqrt-function/m-p/160720#M4410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;There is also the pow() function which works for float numbers.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2008 13:30:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/problems-with-sqrt-function/m-p/160720#M4410</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2008-06-02T13:30:36Z</dc:date>
    </item>
  </channel>
</rss>

