Talk:Count in octal

From Rosetta Code
Revision as of 23:00, 6 June 2011 by rosettacode>Markhobley (fixed integers and native octal)

Dupe?

Now that I think about it, I think this task is covered by Non-decimal radices/Output. I know there's no "loop forever" in that task, but I think it covers the meat of this task (and more). Thoughts? --Mwn3d 03:47, 6 June 2011 (UTC)

Hmm... Seems like it. The "loop over every integer" bit isn't completely trivial, but yeah, it's probably not enough to differentiate this. MagiMaster 03:50, 6 June 2011 (UTC)
The "loop over every integer" requirement is also not practical to implement. 4 billion lines (on a 32 bit machine) might be doable, in terms of time to display -- I am not sure if anyone has the patience to sit through a display of 4 billion lines, but hypothetically speaking a reasonably fast machine could complete this task. However, on a 64 bit machine, you will die of old age before the task completes. And, in my opinion, any task which requires the programmer be dead before the task completes is a bad task. --Rdm 20:04, 6 June 2011 (UTC)
Be careful with your modifiers. We have plenty of good tasks that run for "a really long time"/"forever". Lucas-Lehmer test and Loops/Infinite are good examples. In any case, if the range were smaller I would still call it a duplicate. --Mwn3d 20:10, 6 June 2011 (UTC)
I do not like those tasks either. That said, "forever" really means "until interrupted". --Rdm 20:18, 6 June 2011 (UTC)
The other task mentions number conversion routines. For this task it may be possible to use native octal, rather than number conversion. However, this is not a requirement, so if the language does not support octal, then number conversion is permitted. IMHO It is better to split the common bases (hex,dec,oct,bin) into separate tasks, rather than having one task to implement them all, because a dedicated implementation may be smaller and more efficient than a multibase implementation, so if you are writing an application that has a primary purpose of dealing with octal numbers, it would be better to use dedicated octal number manipulation routines. --Markhobley 20:35, 6 June 2011 (UTC)
Does one of the examples here use "native octal"? I'm not sure what that means. --Mwn3d 20:42, 6 June 2011 (UTC)
Perhaps representing the octal value as a variable width ascii string (instead of a fixed integer) might be "native octal"? --Rdm 21:27, 6 June 2011 (UTC)
If the language natively supports representing fixed integers in octal notation, then it has native octal support. Some languages (such as awk), may support fixed integers, but do not have native octal, because manipulation has to be performed programmatically to make an octal representation. --Markhobley 23:00, 6 June 2011 (UTC)
I'd have to agree that native octal doesn't make much sense. All math routines work in binary, or otherwise operate very similarly regardless of base. Only input and output are different, so if the goal is to demonstrate octal manipulation, IO would be a better task. That's covered by other tasks though. MagiMaster 21:34, 6 June 2011 (UTC)
I am talking about at language level, not cpu level here. --Markhobley 22:50, 6 June 2011 (UTC)