Talk:Middle three digits: Difference between revisions

Line 10:
 
==C++ entry and generalization to other numbers of digits==
The check rejecting the cases where (len % 2 == 0) is only correct if the lengthnumber of digits requested is also odd. ; Itit's perfectly reasonable to request the middle 2 digits of a 4-digit number, etc. So the correct check is to reject the case where the length of the string does not have the same parity as the number of digits being requested (len % 2 != n % 2). [[User:Markjreed|Markjreed]] 05:13, 5 February 2013 (UTC)
 
==Musings on the type of the return value==
1,480

edits