<?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: Negative Numbers in GDL in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41406#M31411</link>
    <description>Putting the parenthesis around the second number worked.&lt;BR /&gt;
&lt;BR /&gt;
To explain why I needed to subtract 2 negatives is a little complicated, but I'll try. I'm doing a Roof Detail GDL that allows for 4 or 5 different roof scenarios (Knee Wall, Finished Floor/Ceiling, Finished Floor/Ceiling with blocking, etc.). I started the 0,0,0 point at the bottom of the blocking which rests on top of the Finished Floor/Ceiling. That means that depending on the pitch of the roof that the user selects, the edge of the overhang for the roof would be a negative number. I also allowed the user to be able to select how long they wanted the vertical stud wall below the Finished Floor/Ceiling to be. Since the user can select brick, stone, shake, etc. (all different heights), I needed to create a formula (trigonometry, geometry, algebra) to calculate the distance between the bottom of the overhang (negative number) and the bottom of the stud wall (negative number from the original 0,0,0) in order to automatically calculate how many brick, stone, shake, etc. that needed to fill in the distance from the bottom of the overhang to the bottom of the stud wall.&lt;BR /&gt;
&lt;BR /&gt;
I finally figured out how to do all this. After thorough checking, I finally figured out one of the variables inside my program was original positive, but I made it negative for the final results. I know that's confusing, but the final output was that I actually ended up with one variable being positive and the other negative which was easier to work with. However, it's good to know that the parenthesis work because I've had other situations that I couldn't get around before because of 2 negative numbers.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for all the advice.</description>
    <pubDate>Tue, 15 May 2007 14:14:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-05-15T14:14:17Z</dc:date>
    <item>
      <title>!Restored: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41395#M31400</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;I'm trying to make variables in GDL, and it's not recognizing negative numbers. For instance, Temp = -0'-2.0000" * -0'-2.0000". I'm also trying to get the difference between 2 negative numbers. For example, the Difference between -1'-0.0000" and -3'-0.0000" should be -2'-0.0000". However, in algebra using Addition, the result would be -4'-0.0000". If I try to subtract 2 negative numbers in GDL, I get an error.&lt;BR /&gt;
&lt;BR /&gt;
Why does GDL not handle negative numbers?&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 May 2007 19:25:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41395#M31400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-02T19:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41396#M31401</link>
      <description>It handles them fine. I use them all the time.&lt;BR /&gt;
&lt;BR /&gt;
Could you give us a little more detail, maybe some actual code?</description>
      <pubDate>Wed, 02 May 2007 19:31:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41396#M31401</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2007-05-02T19:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41397#M31402</link>
      <description>To subtract a negative number is the same as adding a positive one. Are you doing something like "-1 - -3"? Two operators in a row is a no no. As you say the difference (distance on the number line) between -1 and -3 is -2 (but that also depends on the direction you are going), but to get that result you have to add 1 to -3 or subtract 3 from 1.&lt;BR /&gt;
&lt;BR /&gt;
Forgive me if this seems obvious, but I am having trouble understanding the problem. Generally GDL has no trouble with negative numbers. Two exceptions are:&lt;BR /&gt;
&lt;BR /&gt;
1. When a negative length is applied to a solid element; such as a slab with negative thickness.&lt;BR /&gt;
&lt;BR /&gt;
2. When used as an argument in a VALUES statement. This is just a quirk which I get around by assigning the negative values to variables and putting those into the values list.&lt;BR /&gt;
&lt;BR /&gt;
HTH</description>
      <pubDate>Thu, 03 May 2007 08:30:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41397#M31402</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-03T08:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41398#M31403</link>
      <description>&lt;BLOCKQUOTE&gt;Matthew wrote:&lt;BR /&gt;
2. When used as an argument in a VALUES statement. This is just a quirk which I get around by assigning the negative values to variables and putting those into the values list.
&lt;/BLOCKQUOTE&gt;

I'm not sure if I understand your problem exactly here, but there is situations when you need to use ( ) when you work with negative values.&lt;BR /&gt;
But because I don't now when your got your problem, I can't test it.</description>
      <pubDate>Thu, 03 May 2007 09:09:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41398#M31403</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-03T09:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41399#M31404</link>
      <description>&lt;BLOCKQUOTE&gt;TurboGlider wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;Matthew wrote:&lt;BR /&gt;
2. When used as an argument in a VALUES statement. This is just a quirk which I get around by assigning the negative values to variables and putting those into the values list.
&lt;/BLOCKQUOTE&gt;

I'm not sure if I understand your problem exactly here, but there is situations when you need to use ( ) when you work with negative values.&lt;BR /&gt;
But because I don't now when your got your problem, I can't test it.&lt;/BLOCKQUOTE&gt;

I haven't explored this fully. After I found the quick fix I moved on. But the situation is this:&lt;BR /&gt;

&lt;PRE&gt;VALUES "for_example" -2, -1, 0, 1, 2&lt;/PRE&gt;

Results in an error. Whereas:&lt;BR /&gt;

&lt;PRE&gt;n1 = -2
n2 = -1
VALUES "for_example" n1, n2, 0, 1, 2&lt;/PRE&gt;

Works just fine. I believe it is because operations are not supported within the values list and it interprets the minus sign as part of a subtraction.&lt;BR /&gt;
&lt;BR /&gt;
Are you saying that the same result can be achieved with parentheses?&lt;BR /&gt;
Like this:&lt;BR /&gt;

&lt;PRE&gt;VALUES "for_example" (-2), (-1), 0, 1, 2&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 May 2007 16:00:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41399#M31404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-03T16:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41400#M31405</link>
      <description>Yes, parentheses are the solution.&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Thu, 03 May 2007 18:22:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41400#M31405</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2007-05-03T18:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41401#M31406</link>
      <description>&lt;BLOCKQUOTE&gt;Karl wrote:&lt;BR /&gt;Yes, parentheses are the solution.&lt;BR /&gt;
&lt;BR /&gt;
Karl&lt;/BLOCKQUOTE&gt;

Thanks Karl. That seems a little cleaner.</description>
      <pubDate>Fri, 04 May 2007 00:26:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41401#M31406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-04T00:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41402#M31407</link>
      <description>Negative numbers as first values in the VALUES command do not work. another workaround is to use: &lt;B&gt;0-2&lt;/B&gt;&lt;BR /&gt;
I have reported  (and documented on selfgdl &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt; ) that a longer time ago to GS.  I thought it would have been fixed in 10, but it does not look like. &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt;</description>
      <pubDate>Fri, 04 May 2007 06:28:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41402#M31407</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2007-05-04T06:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41403#M31408</link>
      <description>I already gave an example of the problem in my original post, but just to show it again:&lt;BR /&gt;
&lt;BR /&gt;
Temp = -0'-1.0000" - -0'-3.0000"&lt;BR /&gt;
&lt;BR /&gt;
When you make a variable called Temp with -1 minus -3, GDL gives an error.</description>
      <pubDate>Wed, 09 May 2007 18:32:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41403#M31408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-09T18:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41404#M31409</link>
      <description>that looks like matthew's description of two operators in a row.  Have you tried the suggestion  using () around the second number:  &lt;BR /&gt;
&lt;BR /&gt;
-0'-1.0000" - (-0'-3.0000")&lt;BR /&gt;
&lt;BR /&gt;
Does that work?</description>
      <pubDate>Thu, 10 May 2007 01:21:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41404#M31409</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-10T01:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41405#M31410</link>
      <description>&lt;BLOCKQUOTE&gt;Weston wrote:&lt;BR /&gt;that looks like matthew's description of two operators in a row.  Have you tried the suggestion  using () around the second number:  &lt;BR /&gt;
&lt;BR /&gt;
-0'-1.0000" - (-0'-3.0000")&lt;BR /&gt;
&lt;BR /&gt;
Does that work?&lt;/BLOCKQUOTE&gt;

Or how about 3" - 1", or -1" + 3"?&lt;BR /&gt;
&lt;BR /&gt;
Why do you need to subtract a negative number? (Which is the same as adding a positive.)</description>
      <pubDate>Mon, 14 May 2007 16:14:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41405#M31410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-14T16:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Numbers in GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41406#M31411</link>
      <description>Putting the parenthesis around the second number worked.&lt;BR /&gt;
&lt;BR /&gt;
To explain why I needed to subtract 2 negatives is a little complicated, but I'll try. I'm doing a Roof Detail GDL that allows for 4 or 5 different roof scenarios (Knee Wall, Finished Floor/Ceiling, Finished Floor/Ceiling with blocking, etc.). I started the 0,0,0 point at the bottom of the blocking which rests on top of the Finished Floor/Ceiling. That means that depending on the pitch of the roof that the user selects, the edge of the overhang for the roof would be a negative number. I also allowed the user to be able to select how long they wanted the vertical stud wall below the Finished Floor/Ceiling to be. Since the user can select brick, stone, shake, etc. (all different heights), I needed to create a formula (trigonometry, geometry, algebra) to calculate the distance between the bottom of the overhang (negative number) and the bottom of the stud wall (negative number from the original 0,0,0) in order to automatically calculate how many brick, stone, shake, etc. that needed to fill in the distance from the bottom of the overhang to the bottom of the stud wall.&lt;BR /&gt;
&lt;BR /&gt;
I finally figured out how to do all this. After thorough checking, I finally figured out one of the variables inside my program was original positive, but I made it negative for the final results. I know that's confusing, but the final output was that I actually ended up with one variable being positive and the other negative which was easier to work with. However, it's good to know that the parenthesis work because I've had other situations that I couldn't get around before because of 2 negative numbers.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for all the advice.</description>
      <pubDate>Tue, 15 May 2007 14:14:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Restored-Negative-Numbers-in-GDL/m-p/41406#M31411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-15T14:14:17Z</dc:date>
    </item>
  </channel>
</rss>

