<?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: Trying to change negative numbers to postive numbers. in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/trying-to-change-negative-numbers-to-postive-numbers/m-p/3952286#M17976</link>
    <description>Thanks for the help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;The maya help file only shows this &lt;BR /&gt;&lt;PRE&gt;$f=-123;&lt;BR /&gt;abs $f;&lt;BR /&gt;// Result: 123 //&lt;BR /&gt;&lt;BR /&gt;abs &amp;lt;&amp;lt;-1, -2.432, 555&amp;gt;&amp;gt;;&lt;BR /&gt;// Result: &amp;lt;&amp;lt;1, 2.432, 555&amp;gt;&amp;gt;  //&lt;/PRE&gt; &lt;BR /&gt;So I tought I had enought, but clearly not. Thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Thu, 04 Oct 2007 17:12:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-10-04T17:12:10Z</dc:date>
    <item>
      <title>Trying to change negative numbers to postive numbers.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/trying-to-change-negative-numbers-to-postive-numbers/m-p/3952284#M17974</link>
      <description>I am trying to change numbers like -5, -23.46 to turn into 5, 23.46. I hear abs was supposed to do that but it still returns as negative.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;int $n = -26;&lt;BR /&gt;abs $n;&lt;BR /&gt;print $n;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;This returns -26.&lt;BR /&gt;&lt;BR /&gt;Am I doing something completly wrong? I am quite new to mel but it isn't the longes code... Is there a diffrent way of turning negative nr to positve while keeping positive nr positive?</description>
      <pubDate>Thu, 04 Oct 2007 05:12:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/trying-to-change-negative-numbers-to-postive-numbers/m-p/3952284#M17974</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-10-04T05:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to change negative numbers to postive numbers.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/trying-to-change-negative-numbers-to-postive-numbers/m-p/3952285#M17975</link>
      <description>because abs doesn't change the variable in place, you have to capture the result like so.....&lt;BR /&gt;(brackets are so you don't corrupt the namespace and get that   hateful redefination of variable name error!!!...which python doesn't suffer from because it has dynamic typing and is way more cool.)&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;int $d = -26.0;&lt;BR /&gt;$d= `abs($d)`;&lt;BR /&gt;print $d;&lt;BR /&gt;}</description>
      <pubDate>Thu, 04 Oct 2007 07:55:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/trying-to-change-negative-numbers-to-postive-numbers/m-p/3952285#M17975</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-10-04T07:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to change negative numbers to postive numbers.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/trying-to-change-negative-numbers-to-postive-numbers/m-p/3952286#M17976</link>
      <description>Thanks for the help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;The maya help file only shows this &lt;BR /&gt;&lt;PRE&gt;$f=-123;&lt;BR /&gt;abs $f;&lt;BR /&gt;// Result: 123 //&lt;BR /&gt;&lt;BR /&gt;abs &amp;lt;&amp;lt;-1, -2.432, 555&amp;gt;&amp;gt;;&lt;BR /&gt;// Result: &amp;lt;&amp;lt;1, 2.432, 555&amp;gt;&amp;gt;  //&lt;/PRE&gt; &lt;BR /&gt;So I tought I had enought, but clearly not. Thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 04 Oct 2007 17:12:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/trying-to-change-negative-numbers-to-postive-numbers/m-p/3952286#M17976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-10-04T17:12:10Z</dc:date>
    </item>
  </channel>
</rss>

