Talk:One of n lines in a file: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎implicit constraints: Numeric limits)
Line 6: Line 6:
I believe that this task implicitly assumes that a single line will always be small enough to be kept in memory? If so, I think that this assumption should be explicitly stated. (It sounds silly, but it can turn into a real issue.) --[[User:Rdm|Rdm]] 20:19, 14 September 2011 (UTC)
I believe that this task implicitly assumes that a single line will always be small enough to be kept in memory? If so, I think that this assumption should be explicitly stated. (It sounds silly, but it can turn into a real issue.) --[[User:Rdm|Rdm]] 20:19, 14 September 2011 (UTC)
: Choosing a random item from a sequence of unknown length has its uses other than reading files. Actually since the task doesn't ask anyone to read a file anyway, shouldn't it be named something else like, er, "Choosing a random item from a sequence of unknown length"? --[[User:Ledrug|Ledrug]] 20:36, 14 September 2011 (UTC)
: Choosing a random item from a sequence of unknown length has its uses other than reading files. Actually since the task doesn't ask anyone to read a file anyway, shouldn't it be named something else like, er, "Choosing a random item from a sequence of unknown length"? --[[User:Ledrug|Ledrug]] 20:36, 14 September 2011 (UTC)

I don't know whether it's worth noting or not, but there will be issues relating to precision in implementations' real, non-integer numeric types and with precision in its random number generator. --[[User:Short Circuit|Michael Mol]] 21:18, 14 September 2011 (UTC)

Revision as of 21:18, 14 September 2011

Inspiration

I read this and thought of RC. --Paddy3118 22:03, 7 September 2011 (UTC)

implicit constraints

I believe that this task implicitly assumes that a single line will always be small enough to be kept in memory? If so, I think that this assumption should be explicitly stated. (It sounds silly, but it can turn into a real issue.) --Rdm 20:19, 14 September 2011 (UTC)

Choosing a random item from a sequence of unknown length has its uses other than reading files. Actually since the task doesn't ask anyone to read a file anyway, shouldn't it be named something else like, er, "Choosing a random item from a sequence of unknown length"? --Ledrug 20:36, 14 September 2011 (UTC)

I don't know whether it's worth noting or not, but there will be issues relating to precision in implementations' real, non-integer numeric types and with precision in its random number generator. --Michael Mol 21:18, 14 September 2011 (UTC)