Talk:Eban numbers: Difference between revisions
Content added Content deleted
(added a further condition for the "hundreds".) |
Thundergnat (talk | contribs) (→Optimizations?: Ah. Gotcha) |
||
Line 5: | Line 5: | ||
This will allow optimizations to be used.</blockquote> |
This will allow optimizations to be used.</blockquote> |
||
I am mildly curious as to what optimizations this refers to. Maybe I am missing something, but I am failing to how limiting to one sextillion offers any way to optimize. Not so big a deal for the Perl 6 example as it counts the *-ban numbers up to one sextillion 3 times in less than a second (on my system). I just wonder what I am overlooking. --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 21:06, 22 March 2019 (UTC) |
I am mildly curious as to what optimizations this refers to. Maybe I am missing something, but I am failing to see how limiting to one sextillion offers any way to optimize. Not so big a deal for the Perl 6 example as it counts the *-ban numbers up to one sextillion 3 times in less than a second (on my system). I just wonder what I am overlooking. --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 21:06, 22 March 2019 (UTC) |
||
: See the '''REXX''' solution (I think it has the best comments for eliminating numbers that have an '''e''' in them). At this time, I believe there are four other computer programming language solutions that use (more or less) the same algorithm. |
: See the '''REXX''' solution (I think it has the best comments for eliminating numbers that have an '''e''' in them). At this time, I believe there are four other computer programming language solutions that use (more or less) the same algorithm. |
||
Line 19: | Line 19: | ||
: Also of note, the algorithm mentioned (above) should have the numbers pluralized, but then '''twenty''' would become '''twenties'''. and I thought the 2<sup>nd</sup> spelling would maybe confuse some people. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:31, 22 March 2019 (UTC) |
: Also of note, the algorithm mentioned (above) should have the numbers pluralized, but then '''twenty''' would become '''twenties'''. and I thought the 2<sup>nd</sup> spelling would maybe confuse some people. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:31, 22 March 2019 (UTC) |
||
::Ah. Makes sense. I went a different way with Perl 6 but I can see your point. Thanks. --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 23:56, 22 March 2019 (UTC) |
Revision as of 23:56, 22 March 2019
Optimizations?
From the task description:
Only numbers less than one sextillion 1021 will be considered in/for this task.
This will allow optimizations to be used.
I am mildly curious as to what optimizations this refers to. Maybe I am missing something, but I am failing to see how limiting to one sextillion offers any way to optimize. Not so big a deal for the Perl 6 example as it counts the *-ban numbers up to one sextillion 3 times in less than a second (on my system). I just wonder what I am overlooking. --Thundergnat (talk) 21:06, 22 March 2019 (UTC)
- See the REXX solution (I think it has the best comments for eliminating numbers that have an e in them). At this time, I believe there are four other computer programming language solutions that use (more or less) the same algorithm.
- The algorithm roughly is:
- separate the (decimal) number into periods (into groups of three digits starting from the right).
- for the units position, eliminate one, three, five, seven, eight, and nine.
- for the tens position, eliminate ten, eleven, twelve, teens, twenty, seventy, eighty, and ninety.
- for the hundreds position, eliminate all numbers greater than zero and aren't a blank, as any hundred has an e.
- This algorithm will work up to the sextillions (and beyond the septillions, it's hit and miss, so to speak). There are some numbers that have multiple spellings, so I included that sextillion limit to bypass these minefields. -- Gerard Schildberger (talk) 23:31, 22 March 2019 (UTC)
- Also of note, the algorithm mentioned (above) should have the numbers pluralized, but then twenty would become twenties. and I thought the 2nd spelling would maybe confuse some people. -- Gerard Schildberger (talk) 23:31, 22 March 2019 (UTC)
- Ah. Makes sense. I went a different way with Perl 6 but I can see your point. Thanks. --Thundergnat (talk) 23:56, 22 March 2019 (UTC)