<?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: avoiding -1.#IND values in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045444#M25638</link>
    <description>I will. Thanks for the help anyhow. Appreciate it.</description>
    <pubDate>Thu, 20 Nov 2008 20:01:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-11-20T20:01:10Z</dc:date>
    <item>
      <title>avoiding -1.#IND values</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045437#M25631</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Can someone tell me why I'm getting values fine until loop 24 when it starts spitting out -1.#IND? How can I avoid it?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Mark&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;sizeArray = #()&lt;BR /&gt;radius = 1.0&lt;BR /&gt;multiplier = 1&lt;BR /&gt;for i = 1 to 30 do&lt;BR /&gt;    (&lt;BR /&gt;        radius = multiplier * sqrt(10^(0.4 * i))&lt;BR /&gt;        sizeArray&lt;I&gt; = radius&lt;BR /&gt;    )&lt;BR /&gt;    print sizeArray&lt;BR /&gt;&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Nov 2008 23:52:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045437#M25631</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-11-19T23:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding -1.#IND values</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045438#M25632</link>
      <description>I think you're hitting the limits of Max's accuracy. (see image)&lt;BR /&gt;&lt;BR /&gt;0.4*24 is 9.6 - greater than the apparent limit of 9.331. The resultant value is negative, and you can't take the square root of a negative number, hence the "-1.#IND"&lt;BR /&gt;&lt;BR /&gt;To avoid? Split the calculation into sections and test that the result is not negative before attempting the sqrt.&lt;BR /&gt;&lt;BR /&gt;And btw&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;sizeArray  = radius&lt;BR /&gt;-- should be &lt;BR /&gt;sizeArray&lt;I&gt; = radius&lt;BR /&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;if you want an array of the results, otherwise you're simply assigning the last result to an ordinary variable.&lt;P&gt;&lt;IMG class="migr-att-link" src="http://area.autodesk.com/userdata/forum/1/13660_YTrZQ652km0rSOFYGI1F.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Nov 2008 01:01:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045438#M25632</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2008-11-20T01:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding -1.#IND values</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045439#M25633</link>
      <description>That's correct.. Its an integer limit.  You can designate a Long Int on the 10 value to get a futher along.. but sooner or later you'll have an overrun...&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;sizeArray = #()&lt;BR /&gt;radius = 1.0&lt;BR /&gt;multiplier = 1&lt;BR /&gt;for i = 1 to 48 do&lt;BR /&gt;    (&lt;BR /&gt;        radius = multiplier * sqrt( 10L ^ (0.4 * i) )&lt;BR /&gt;        sizeArray&lt;I&gt; = radius&lt;BR /&gt;    )&lt;BR /&gt;print sizeArray&lt;BR /&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;seems  ~48  is the value at which the long int overflows for this formula.</description>
      <pubDate>Thu, 20 Nov 2008 06:05:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045439#M25633</guid>
      <dc:creator>keithm</dc:creator>
      <dc:date>2008-11-20T06:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding -1.#IND values</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045440#M25634</link>
      <description>Thanks. I just need to get to 30, so long integer will do the job.&lt;BR /&gt;&lt;BR /&gt;Mind if I ask a related question? Mathematically, how would I compress the resulting values so that the bottom value remained the same and the most compression was applied to the top value. Kind of like laying an opened concertina end up on the floor and pushing down. The higher the value, the lower it gets pulled down, except that the values keep their numerical order?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Mark</description>
      <pubDate>Thu, 20 Nov 2008 11:55:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045440#M25634</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-11-20T11:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding -1.#IND values</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045441#M25635</link>
      <description>I'd use a Hose (extended) Primitive - either directly or as a "controller" for the real object because the maths are already done for you.&lt;BR /&gt;&lt;BR /&gt;It does depend on exactly what you're trying to do, whether the "gaps" between the "sections" are always evenly spaced and so on.</description>
      <pubDate>Thu, 20 Nov 2008 18:38:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045441#M25635</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2008-11-20T18:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding -1.#IND values</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045442#M25636</link>
      <description>It took me a while to catch on there. Thanks. I'm not trying to make an actual concertina. I'm trying to compress a range of values while keeping the bottom value the same. Like the example in the loop below. Except the compression isn't working well because the value for i=1 gives me a number higher than for i=2. From i=2 upwards I'm ok. But I'm looking for a better way to compress values with some variable I can change to alter the degree of compression. Maths isn't my speciality.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;sizeArray = #()&lt;BR /&gt;radius = 1.0&lt;BR /&gt;multiplier = 1&lt;BR /&gt;compressionRatio = 0.1&lt;BR /&gt;for i = 1 to 48 do&lt;BR /&gt;    (&lt;BR /&gt;        radius = multiplier * sqrt( 10L ^ (0.4 * i) )&lt;BR /&gt;        compressedRadius = radius * compressionRatio/i&lt;BR /&gt;        sizeArray&lt;I&gt; = compressedRadius&lt;BR /&gt;    )&lt;BR /&gt;print sizeArray &lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Nov 2008 19:53:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045442#M25636</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-11-20T19:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding -1.#IND values</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045443#M25637</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;  Maths isn't my speciality. &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Nor mine, I'm afraid &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;If you don't get any answers here maybe try a maths-specific site - it's more of a "principles" question than one related specifically to Maxscript so you may get more responses on a dedicated site.</description>
      <pubDate>Thu, 20 Nov 2008 19:58:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045443#M25637</guid>
      <dc:creator>Steve_Curley</dc:creator>
      <dc:date>2008-11-20T19:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: avoiding -1.#IND values</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045444#M25638</link>
      <description>I will. Thanks for the help anyhow. Appreciate it.</description>
      <pubDate>Thu, 20 Nov 2008 20:01:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/avoiding-1-ind-values/m-p/4045444#M25638</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-11-20T20:01:10Z</dc:date>
    </item>
  </channel>
</rss>

