<?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: Compare value with list in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10333888#M60199</link>
    <description>&lt;P&gt;I wrote this earlier today, but something snapped... gone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Real numbers are not as exact as one might think.&lt;/P&gt;
&lt;P&gt;If you are looking for matches that are close enough then&lt;/P&gt;
&lt;P&gt;(setq fuzz 0.00001) ;; or whatever you like, then&lt;/P&gt;
&lt;P&gt;(vl-every '(lambda (x)(equal val x fuzz)) lst)&lt;/P&gt;</description>
    <pubDate>Sun, 23 May 2021 23:52:41 GMT</pubDate>
    <dc:creator>john.uhden</dc:creator>
    <dc:date>2021-05-23T23:52:41Z</dc:date>
    <item>
      <title>Compare value with list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10328344#M60196</link>
      <description>&lt;P&gt;Hello boys how are you.&lt;/P&gt;&lt;P&gt;I wanted to ask you, how can I compare a numerical value with a list and know if they are the same or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;setq&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;val&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;0.0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;setq&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;lst '(&lt;/SPAN&gt;&lt;SPAN&gt;-0.23297&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-0.23297&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;1.0 0.05 4&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;val contains the value to compare.&amp;nbsp;This value can be any.&lt;/P&gt;&lt;P&gt;lst contains a list of values, this list can have one or more values.&lt;/P&gt;&lt;P&gt;I need it to return T if all the values of the variable lst are equal to the value of the variable val.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Beforehand thank you very much.&lt;/DIV&gt;</description>
      <pubDate>Fri, 21 May 2021 04:41:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10328344#M60196</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2021-05-21T04:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Compare value with list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10328513#M60197</link>
      <description>&lt;P&gt;Try&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(apply '= (cons val lst))&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 06:33:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10328513#M60197</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2021-05-21T06:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Compare value with list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10333813#M60198</link>
      <description>&lt;P&gt;Hello brother, thanks for your help, it worked very well.&lt;/P&gt;&lt;P&gt;Greetings.&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 22:35:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10333813#M60198</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2021-05-23T22:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Compare value with list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10333888#M60199</link>
      <description>&lt;P&gt;I wrote this earlier today, but something snapped... gone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Real numbers are not as exact as one might think.&lt;/P&gt;
&lt;P&gt;If you are looking for matches that are close enough then&lt;/P&gt;
&lt;P&gt;(setq fuzz 0.00001) ;; or whatever you like, then&lt;/P&gt;
&lt;P&gt;(vl-every '(lambda (x)(equal val x fuzz)) lst)&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 23:52:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10333888#M60199</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-05-23T23:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Compare value with list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10333991#M60200</link>
      <description>&lt;P&gt;Hello Brother how are you.&lt;BR /&gt;I tried your option and it works very well for me.&lt;BR /&gt;I think the more exact the better.&lt;BR /&gt;I don't know which is better.&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 01:03:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10333991#M60200</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2021-05-24T01:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Compare value with list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10334196#M60201</link>
      <description>IMO, use your acceptable tolerance when comparing real numbers.</description>
      <pubDate>Mon, 24 May 2021 03:57:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10334196#M60201</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-05-24T03:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Compare value with list</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10334272#M60202</link>
      <description>&lt;P&gt;Hello guys, thanks for all the opinions and help, I will take them into account.&lt;BR /&gt;Greetings.&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 05:09:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-value-with-list/m-p/10334272#M60202</guid>
      <dc:creator>carlos_m_gil_p</dc:creator>
      <dc:date>2021-05-24T05:09:26Z</dc:date>
    </item>
  </channel>
</rss>

