Can you give us an estimate of how much you have to break it? I think I've had close to 2 millions in my alliance without it breaking.
http://en.cppreference.com/w/c/types/limitsCan you give us an estimate of how much you have to break it? I think I've had close to 2 millions in my alliance without it breaking.
~ (2^31) / 1000 is the limit
May seem stupid, but why use signed numbers for things like troops ? It's not like if we're supposed to go in the negative~ (2^31) / 1000 is the limit
May seem stupid, but why use signed numbers for things like troops ? It's not like if we're supposed to go in the negative
Thanks a lot !I don't recommend ever using unsigned except in bit manipulation code or where you otherwise explicitly need unsigned semantics. Aside from that, the fixed point arithmetic in Clausewitz is 32/64 bit only for above reasons. Many programming languages also lack support for unsigned because the designers know it's a noob trap.
- Signed numbers make overflows more visible in a lot of code that assumes variables are >= 0, if you see a negative number in such a variable you immediately know it's an overflow.
- Having 32 unsigned bits of precision is great until you suddenly need to apply them in a signed equation because you misjudged, or had changed requirements...
- Programmers are generally more familiar with signed arithmetic and not familiar with unsigned/signed mismatch casting.
- Despite the 50% difference, the gain of 1 bit never makes a practical difference in the vast majority of code. If you had an overflow at 31 bits chances are you would also get it at 32 bits.
- Having to think about what type of integer to use when coding higher level problems is vast of effort/time.
- In case of 64 bit signed arithmetic which is getting more common since x64, you're probably not going to overflow anyway.
Uhm, imho signed or unsigned is not the question here, but rather the 1/1000: Why can a single soldier be split into thousand parts? I mean I get the digits for money and stuff, but soldiers?~ (2^31) / 1000 is the limit
Why can a single soldier be split into thousand parts?
This question is best answered by Mr 24 pounder shrapnel shell![]()
byzantium, moved to america to deal with cnsWho did you start as?