Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
types

 
Post new topic   Reply to topic Printable version
 View previous topic  Please delete me. Post :: Post Updated TWCore  View next topic  
Author Message
help!
Guest


Offline

PostPosted: Thu Feb 19, 2004 6:34 pm    Post subject: types Reply to topic Reply with quote

why did catid make so many different numeric types of data structures ie:Uint32.. etc ? why wouldnt a simple int work... thanx in advance
Back to top
ExplodyThingy
Server Help Squatter


Age:38
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Thu Feb 19, 2004 6:49 pm    Post subject: Reply to topic Reply with quote

Because, its smaller and more effective.
_________________
There are no stupid question, but there are many inquisitive idiots.
Loot

Dr Brain> I hate clean air and clean water. I'm a member of Evil Conservitive Industries
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Thu Feb 19, 2004 6:50 pm    Post subject: Reply to topic Reply with quote

Well, it's a major pain when you want to type 'unsigned blah' over and over again. And the reason it can't just be signed is because numbers can go over the halfway point of an int in SS, causing them to be negative. Basically, it's just a lot cleaner (and more secure) to keep unsigned numbers unsigned.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Helicon
Server Help Squatter


Joined: Dec 03 2002
Posts: 771
Location: GNU Doldrums
Offline

PostPosted: Thu Feb 19, 2004 7:46 pm    Post subject: Reply to topic Reply with quote

Uint32, etc are usually macro-defined shortcuts for types in (usually) c-likelanguages, among others.
The problem with packaged ints is that they may use much more space than is necessary.
For instance, a built-in integer for any given language may be 32 bits, which then supports (correct me if im wrong) positive and negative integers with absolute value of 512.
However, what if i need values up to 1000? setting a uint32 (unsigned int 32 bits) gets me ONLY positive number support up to 1024.

Code: Show/Hide

int x = 1020; //error
uint32 y = 1020; //ok


also, shorthand primitives may be used to save space, as in using only a sint16 (signed integer 16 bits) rather than just an int (which 16 unnecessary bits);
Code: Show/Hide

for(int x=0;x<=200;x++){
int y = x; //memory waste!
sint z = d; //thats a little better
}


once again, i didn't check my math here (i shouldknow it by heart), so please take the literals only as stand-in placeholders
_________________
Signatures just seem so quaint.
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Thu Feb 19, 2004 8:13 pm    Post subject: Reply to topic Reply with quote

32 bits gives a helluva lot more room than +-512.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Helicon
Server Help Squatter


Joined: Dec 03 2002
Posts: 771
Location: GNU Doldrums
Offline

PostPosted: Thu Feb 19, 2004 9:25 pm    Post subject: Reply to topic Reply with quote

msdn wrote:
The Int32 value type represents signed integers with values ranging from negative 2,147,483,648 through positive 2,147,483,647.
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Thu Feb 19, 2004 10:24 pm    Post subject: Reply to topic Reply with quote

Except you use UInt which is... double that.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 283 page(s) served in previous 5 minutes.

phpBB Created this page in 0.492221 seconds : 31 queries executed (94.6%): GZIP compression disabled