<?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: Just testing you in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383542#M59506</link>
    <description>&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&lt;BR /&gt;You sorta beat around the bush with that answer, but You deserve an A+ for&lt;BR /&gt;demonstrating that you totally understood.  Yes, I saw that you changed one&lt;BR /&gt;of the operands to a 'REAL.&lt;BR /&gt;Seems like even long integers have their limit in AutoLisp.&lt;BR /&gt;&lt;BR /&gt;Anyone else?</description>
    <pubDate>Fri, 11 Jun 2021 19:16:22 GMT</pubDate>
    <dc:creator>john.uhden</dc:creator>
    <dc:date>2021-06-11T19:16:22Z</dc:date>
    <item>
      <title>Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383346#M59504</link>
      <description>&lt;P&gt;What's wrong with this code?&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun factorial (n / product)
  (setq i 0 product 1)
  (repeat n
    (setq i (1+ i) product (* i product))
  )
  product
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 11 Jun 2021 17:38:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383346#M59504</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-06-11T17:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383405#M59505</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;What's wrong with this code?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;It works as &lt;STRONG&gt;expected. &lt;/STRONG&gt;&amp;lt;--- it does have a limit,&amp;nbsp; like most things&amp;nbsp; in lisp that deals with &lt;STRONG&gt;integers&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(defun factorial (n / product)
  (setq i 0.0 product 1)
  (repeat n
    (setq i (1+ i) product (* i product))
  )
  (fix product)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 18:06:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383405#M59505</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-06-11T18:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383542#M59506</link>
      <description>&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&lt;BR /&gt;You sorta beat around the bush with that answer, but You deserve an A+ for&lt;BR /&gt;demonstrating that you totally understood.  Yes, I saw that you changed one&lt;BR /&gt;of the operands to a 'REAL.&lt;BR /&gt;Seems like even long integers have their limit in AutoLisp.&lt;BR /&gt;&lt;BR /&gt;Anyone else?</description>
      <pubDate>Fri, 11 Jun 2021 19:16:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383542#M59506</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-06-11T19:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383561#M59507</link>
      <description>&lt;LI-CODE lang="markup"&gt;(defun factorial (n / product)
  (setq i 0 product 1.0)
  (repeat n
    (setq i (1+ i) product (* i product))
  )
  product
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes. Integers have limits in autolisp too.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 19:25:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383561#M59507</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-06-11T19:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383895#M59508</link>
      <description>&lt;P&gt;IMO, the ideal factorial function should be recursive, not iterative. It is the paradigm for a recursive definition. If the user wants a real result, then, he should provide a real argument, else, he should accept the limitations of integers.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun factorial (n)
  (if (= n 1) 1
  (* n (factorial (1- n)))))&lt;/LI-CODE&gt;
&lt;P&gt;Since its only defined for positive whole numbers(integers in real math), that is all you should need to do.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 22:49:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383895#M59508</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2021-06-11T22:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383947#M59509</link>
      <description>@Anonymous&lt;BR /&gt;Whoa!  I ain't never been too good with recursion.&lt;BR /&gt;Gotta study that and probably give you an A++.&lt;BR /&gt;I will do a time test, of course.</description>
      <pubDate>Fri, 11 Jun 2021 23:24:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10383947#M59509</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-06-11T23:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10384892#M59510</link>
      <description>&lt;P&gt;Thanks but time tests are probably irrelevant.&amp;nbsp; Factorial results increase faster than exponentially.&amp;nbsp; You probably won't want a number larger than 64 as input.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jun 2021 12:21:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10384892#M59510</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2021-06-12T12:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10385587#M59511</link>
      <description>&lt;P&gt;Next question:&lt;/P&gt;
&lt;P&gt;What's the largest integer that AutoLisp can handle?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jun 2021 21:20:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10385587#M59511</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-06-12T21:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10386863#M59512</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Next question:&lt;/P&gt;
&lt;P&gt;What's the largest integer that AutoLisp can handle?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;2147483647&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-EF6114FC-F1E4-4C71-91CC-07D01E6C8ABB" target="_blank"&gt;https://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-EF6114FC-F1E4-4C71-91CC-07D01E6C8ABB&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jun 2021 16:02:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10386863#M59512</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2021-06-13T16:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10386875#M59513</link>
      <description>Hi, Jeff.&lt;BR /&gt;Well done, even though you cheated.&lt;BR /&gt;Didja notice it's one shy of (expt 2 31)?&lt;BR /&gt;which turns negative and (abs) can do nothing to it.</description>
      <pubDate>Sun, 13 Jun 2021 16:19:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10386875#M59513</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-06-13T16:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Just testing you</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10391501#M59514</link>
      <description>&lt;P&gt;This one also works in Common Lisp:&lt;/P&gt;&lt;P&gt;CLO 17 &amp;gt; (factorial 92)&lt;BR /&gt;12438414054641307255475324325873553077577991715875414356840239582938137710983519518443046123837041347353107486982656753664000000000000000000000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- The trick here is that CL has bignums when it runs out of space on integers.&lt;/P&gt;&lt;P&gt;- Also demonstrates the problem with recursive functions, on 93 I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stack overflow (stack size 15998).&lt;BR /&gt;[Condition of type CONDITIONS:STACK-OVERFLOW]&lt;/P&gt;&lt;P&gt;Restarts:&lt;BR /&gt;0: [CONTINUE] Extend stack by 50%.&lt;BR /&gt;1: [ABORT] Return to top loop level 0.&lt;BR /&gt;2: [ABORT] Quit process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if I really needed larger ones, I'd need to change to another algorithm (iterative or&amp;nbsp; recursive with memoizing or using an accumulator).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 11:08:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/just-testing-you/m-p/10391501#M59514</guid>
      <dc:creator>martti.halminen</dc:creator>
      <dc:date>2021-06-15T11:08:30Z</dc:date>
    </item>
  </channel>
</rss>

