negative exp

Found a bug with the CensusPlus UI Mod? Post it here!
Post Reply
erypmav
Posts: 50
Joined: Tue Oct 25, 2005 2:57 am

negative exp

Post by erypmav »

I noticed negative exp show on the screen. If you want to look into it here is a screenshot of what I am talking about.

Image
Image
Image

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

Yeah, this is due to it not being able to display numbers so I high when you have a few folks in your local database. I need to spend some time rethinking this.
phpbb:phpinfo()

RavenDT
Posts: 2
Joined: Thu Oct 06, 2005 3:58 pm
Location: Pensacola, FL
Contact:

Post by RavenDT »

Yeah, this has to do with basic number types in C++. An integer can only go so high before it rolls over. A "long int (signed)" can only go from -2,147,483,648 to 2,147,483,647... So once it goes higher than 2,147,483,647, it becomes -2,147,483,648. Same with an "unsigned long int" that goes from 0 to 4,294,967,295. Once it hits 4,....296, it actually goes back to 0.

The way to prevent this is a weird work around. The way we fixed this in C++ class was we made a whole seperate class that worked with characters. The class basically was a chain of characters linked together by pointers...

So 3,342,674,943,209,521,034 would be:
"4","3","0","1","2","5","9",pointer to 0->
"0","2","3","4","9","4","7",pointer to 6->
"6","2","4","3","3","null","null",null pointer

Unfortunately, I don't think you can define your own class nor can you use memory pointers in an addon, but I don't make addons, I just use them, so I wouldn't know.

Post Reply