On a side note. I spend a long time thinking about this overflow code, and I don't think there's any edge cases left. But no one's perfect, and if you can find a failing case, I'll figure out something nice to do for you.
This new initiative of daily updates is fantastic. Even if they don't manifest in playable content, it really keeps us in the loop. Thank you.
Yes! Someone else knows about tech debt! AND they're willing to start paying it off! Can you talk to my managers?
As a former wannabe programmer, I actually found this interesting. b As a former wannabe programmer, I was also dumbfounded by parts of your code, lol.
This may be stupid on my part, but isn't the max value of an int 32767 and the min -32767? Or is there something I'm missing that defines it as a long int?
I don't C++, but template <typename Int> as the first line seems to indicate something here. You're talking about the range of an int, lowercase i. This uses Int, uppercase. Things like std::numeric_limits<Int>::min() sound to me like it works on any integer type and range, not just int and 362767.
Although you lost me at "today", I'm really happy to see progress. Keep up the good work guys! We love you.
But I need 10,000,000 all at once. Cash up front; no exceptions. And it's none of your business for what.
Implemented !a || !b Better (a & b) == 0 Also for mult, div is costly, so this: http://stackoverflow.com/questions/...lication-of-uint64-t-integers-overflow-with-c But then again, Starbound doesn't probably need that much optimization.
hmm... in my game i just use Math.Min and Math.Max on each serialization. Something like this var money = 99999; money = Math.Min(0, money ); money = Math.Max(money, maxLimit);
All the "std::numeric_limits<Int>::min()" line indicates is that it's calling the minimum limit of the variable type (in this case int). The question really boils down to the number of bits associated to int in this instance. As I thought, a standard int was 16-bit, where as a long int was 32-bit.] EDIT: My knowledge is admittedly a little dated and this may have changed since I last used C++
No stop, stop right there. It's not calling the minimum limit of int, it's calling that of Int, which can be any integer type.
Me: *reads post* Hmmm....I see, I see. Omni: You have no idea what you're looking at do you. Me: Not a freaking clue in the world, but the fact you do is the most important thing here Omni: Get out.