Post: What is the size of int in GSC?
06-05-2017, 05:49 AM #1
Zakira
Haxor!
(adsbygoogle = window.adsbygoogle || []).push({}); The title says it all: what is the size of int? I am not sure whether the size is dependent on the computer architecture or the compiler, but I am using the GSC Studio. I was testing a GSC menu when I found out some of the higher negative numbers were not being interpreted as negative numbers. For example, I have a conditional statement of if (value > 0) do something and print value else do something else and print value. When I pass in -100000, the number is interpreted as 100000 and follows the first conditional statement, printing out 100000.
With this being said, I had a separate test where I printed out high negative numbers (from -1 to -1E10), and this seem to print the numbers right. Anybody have an idea why this might be happening?

TLAwesome faceR: Any idea why some high negative numbers do not register as negative numbers, instead is registered as positive number?
06-05-2017, 11:27 AM #2
anthonything
Space Ninja
Originally posted by Zakira View Post
The title says it all: what is the size of int? I am not sure whether the size is dependent on the computer architecture or the compiler, but I am using the GSC Studio. I was testing a GSC menu when I found out some of the higher negative numbers were not being interpreted as negative numbers. For example, I have a conditional statement of if (value > 0) do something and print value else do something else and print value. When I pass in -100000, the number is interpreted as 100000 and follows the first conditional statement, printing out 100000.
With this being said, I had a separate test where I printed out high negative numbers (from -1 to -1E10), and this seem to print the numbers right. Anybody have an idea why this might be happening?

TLAwesome faceR: Any idea why some high negative numbers do not register as negative numbers, instead is registered as positive number?


Eh its the compiler. DTX thought he was being clever and did a weird ass if statement logic that ignores negatives completely that basically will check for size and try to optimize to the correct data structure (ie: byte, short or int). There is a ton of things wrong with this compiler so its just another thing you'll have to work around for now

Also for the future: bytes and shorts are unsigned values that are signed by an OPCode, and integers (anything over 65,535 or below -65,535) are normal range (–2,147,483,648 to 2,147,483,647))
Last edited by anthonything ; 06-05-2017 at 11:58 AM.

The following user groaned anthonything for this awful post:

DF_AUS
06-05-2017, 06:13 PM #3
Zakira
Haxor!
Originally posted by DamnMagician View Post
Eh its the compiler. DTX thought he was being clever and did a weird ass if statement logic that ignores negatives completely that basically will check for size and try to optimize to the correct data structure (ie: byte, short or int). There is a ton of things wrong with this compiler so its just another thing you'll have to work around for now

Also for the future: bytes and shorts are unsigned values that are signed by an OPCode, and integers (anything over 65,535 or below -65,535) are normal range (–2,147,483,648 to 2,147,483,647))


Ok, good to find out it's the compiler. Should I use your Terminus GSC to compile my projects? Does your compiler have any issue with this?

The following user thanked Zakira for this useful post:

anthonything
06-05-2017, 11:39 PM #4
anthonything
Space Ninja
Originally posted by Zakira View Post
Ok, good to find out it's the compiler. Should I use your Terminus GSC to compile my projects? Does your compiler have any issue with this?


It is still the DTX compiler, sorry :(.

Copyright © 2025, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo