[Tutor] please return flys in ointment

Dave Angel davea at davea.name
Sun Jul 7 09:05:51 CEST 2013


On 07/07/2013 02:47 AM, Jim Mooney wrote:
> On 6 July 2013 22:52, Dave Angel <davea at davea.name> wrote:
> The
>> other author does not use hyphens or commas in the words.  He ends each
>> string with a blank.  And he neglected to handle zero.

>
>> He also is buggy beyond a nonillion-1.

I found yet another implementation that does work up to at least a 
decillion, and it agrees with yours throughout (actually, the testing 
was done with the same million random probes as what I posted earlier.)

However, he also omits the commas and the hyphens.

An interesting site is:

http://rosettacode.org/wiki/Names_to_numbers

which has a bunch of different languages (and programmers) implementing 
the same concept.  Note that the spec didn't say how the words should be 
laid out, and there are many variations in result between the various 
implementations.  These include not only the hyphens, commas, but also 
the use of the word 'and' between some parts of the numbers.




-- 
DaveA



More information about the Tutor mailing list