Talk:Middle three digits: Difference between revisions

Content added Content deleted
(→‎Musings on the type of the return value: return value can not be integer)
Line 18: Line 18:


Others have functions that return integers. It is just as valid, just different. I guess the middle three digits can be calculated with modulo arithmetic and without any use of strings. In that case it may be easier to return the integer result and rely on output formatting to zero-extend results to three digits on printing? Different strokes and all that. --[[User:Paddy3118|Paddy3118]] 07:01, 5 February 2013 (UTC)
Others have functions that return integers. It is just as valid, just different. I guess the middle three digits can be calculated with modulo arithmetic and without any use of strings. In that case it may be easier to return the integer result and rely on output formatting to zero-extend results to three digits on printing? Different strokes and all that. --[[User:Paddy3118|Paddy3118]] 07:01, 5 February 2013 (UTC)

:The requirement was to return middle three digits. That can not be done with integer, since integer does not contain digits. --[[User:PauliKL|PauliKL]] 16:16, 5 February 2013 (UTC)