3 ms·
I remember disconnecting my dialup session and checking that nobody is on the phone as the clock ticked midnight just to make sure we don't get billed for a 100
by close04 7y ago
I remember disconnecting my dialup session and checking that nobody is on the phone as the clock ticked midnight just to make sure we don't get billed for a 100 year long call.
- falcor84 7y agoHow would that have happened? The expectated bug outcome is of a negative duration, no?
- greggyb 7y agoNegative durations are clearly impossible. Just take ABS of the duration to be safe....
- NullPrefix 7y agoOn the other hand, if there's no such check you might be able to get 100 year call time credit.
- greggyb 7y agoGotta love those rollover minutes.
- xxs 7y agoUnless, of course, you hit MIN_VALUE [abs(min_value) == min_value] One of signs of inexperience is using abs(int) in hash functions...
- greggyb 7y agoGosh, I am spoiled by languages with decent numeric towers. You mention it as a sign of inexperience, and I can't really disagree with you. Just adding a nuance that inexperience can be due to loss of experience as easily as lack of experience.
- xxs 7y agoIf you do hashtable/hashmap on a language that has no fixed integer type... well yeah. But normally you'd like the data structures to map really well to the hardware. Pretty much all modern CPUs are two's complement ones - hence min integer is impossible to convert to anything else (having just the highest/sign bit, and rest zero)
- _____-___ 7y agoSucker, missed out on being paid for a 100 year long phone call.