Friday, March 1, 2019

Counting

Did you know that Alexa knows how to count? Maybe I shouldn't have been surprised, since counting is probably the most basic computing task there is... but we were still delighted at Alexa's ability to count. And it's not even just the simple counts - it can count downwards, and it can count by a number (though it counts in one-based numbering, so if you ask it to "count by 5", it counts 1, 6, 11... once again proving that zero-based numbering is The One And True Way).

The most interesting part, though, are the limits. Alexa can count only 100 elements - if you start at 1, it means 101 is the largest number that it can count to. As far as I can tell, they're using signed 64 bit integer, and the counting routine seems to treat "Quintillion" as "Million". The question here is, are these limits a product of a thorough spec? or multiple requirements meetings? Or, just maybe, some poor lambda routine spent 3 hours of compute time counting to a Quintillion then tried to send a multi-terabyte string down to the device and some poor shmuck got paged with a '?' that one time...

No comments:

Post a Comment