4 ms·
I suspect for a lot of people coding against Twitter the notion of integers being signed or unsigned is about as foreign to their experience as pointer arithmet
by patio11 17y ago
I suspect for a lot of people coding against Twitter the notion of integers being signed or unsigned is about as foreign to their experience as pointer arithmetic. I do not consider that a bad thing.
irb > "2,147,483,647".gsub(",","").to_i + 1
2147483648
(Forgive the extra code necessary to strip out the commas. The Windows irb console leaves a little to be desired in terms of midline editing.)
- there 17y agoyou know ruby supports _ as a comma separator, right? irb(main):002:0> 2_147_483_647 + 1 => 2147483648