Anonymous user
Talk:Loops/Nested: Difference between revisions
m
→Task Clarification: fixed some typos, reinstated intended whitespace.
m (→Task Clarification: added another comment about another assumption. -- ~~~~) |
m (→Task Clarification: fixed some typos, reinstated intended whitespace.) |
||
Line 1:
==Task Clarification==
When the task description said numbers from 1..20, did it mean integers?
<br>If not, the REXX example could also use numbers with decimal parts.
<br>Some languages (like REXX) can handle both at the same time.
Also, it wasn't stated
: I'd assume it meant integers; if not, the likelihood of encountering a “20” is too small. (Yes, it could be implemented otherwise, but what would be the point of that?) Another reason for assuming integer is that it says <math>[1\ldots 20]</math> and not <math>[1.0\ldots 20.0]</math> –[[User:Dkf|Donal Fellows]] 10:23, 15 May 2012 (UTC)
:: The point that I was asking for clarification. If the task was to use integers, then just say so. Otherwise, it's a matter of assumptions, and programs based on assumptions more often than not, make the wrong assumptions. In most languages, if the array is declared to be integer, then that's what's stored. Most examples generated their own arrays, so the programmer knows what to expect, so whatever the programmer
|