3 ms·
I also wrote a function in Pascal to convert integers to natural language exactly. E.g. here is the output for 100000! https://gist.github.com/benibela/f0163b02
by benibela 7y ago
I also wrote a function in Pascal to convert integers to natural language exactly. E.g. here is the output for 100000! https://gist.github.com/benibela/f0163b02562f647e4d2f https://gist.github.com/benibela/f0163b02562f647e4d2f
- jagged-chisel 7y agoIt's 8.8MB of plaintext English output describing the ridiculously long number, for those on mobile (who can't see the full file), or who don't want to click through the 'file is truncated...' link
- benibela 7y agoAs an approximation, one could just say three duoquinquagintacentillinonagintacentillion
- pbhjpbhj 7y agoIsn't "one hundred thousand factorial" a more useful conversion? Would your conversion ever find utility? Aside, this is why French style punctuation with a space before ? or ! is superior.
- benibela 7y agoI did not write it to be useful. I just wanted to say it can handle large integers. I am implementing the XPath standard. The standard says there need to be a function to convert integers to English, but it does not specify an upper limit on the integers
- pbhjpbhj 7y agoCool, IMO that makes it potentially useful (but being useful isn't required of course). Out of curiosity, what part of the spec does that implement? Is it to do with fn:format-integer.
- benibela 7y agoHere is the function standard: https://www.w3.org/TR/xpath-functions-31/#func-format-integer https://www.w3.org/TR/xpath-functions-31/#func-format-intege... Number formatting is really complicated