designerdecimal

find a decimal representation of your name, and the rational approximation thereof
git clone https://wehaveforgeathome.hates.computer/designerdecimal.git
Log | Files | Refs | LICENSE

README.md (1614B)


      1 Designer Decimal
      2 ====
      3 
      4 I'm fairly certain I got this idea from a story on Reddit, but between writing this and moving it to github, the ephemera machine that is the internet has devoured the original source. If you happen to know the source, please let me know.
      5 
      6 To create the designer decimal of a string, convert each character to [ASCII](http://en.wikipedia.org/wiki/ASCII) with enough leading zeros to take of three characters ('A' becomes '065', etc). Add a leading '1.' and a trailing ['004'](http://en.wikipedia.org/wiki/End-of-transmission_character). The result is a decimal encoding of your string, which the original article had the clever name for "Desinger Decimal."
      7 
      8 This project does the boring encoding bit for you. Since I was bummed that the results are so long, it also finds a rational approximation which may be more suitable for sticking on business cards.
      9 
     10 My first few attempts were incredible slow to converge on a rational approximations, and I had a lot of fun researching better methods.
     11 
     12 Usage
     13 -----
     14 
     15     $ perl designerdecimal.pl Lyndon B. Johnson
     16     For the name 'Lyndon B. Johnson':
     17       Your designer decimal is 1.076121110100111110032066046032074111104110115111110004
     18       Your rational approximation is 1162140322362708323736326654 / 1079934508723274540452148297
     19     Took 53 iterations
     20 
     21 Thanks To
     22 -----
     23 
     24 ["Algorithm to Convert a Decimal to a Fraction"](http://homepage.smc.edu/kennedy_john/DEC2FRAC.PDF) by John Kennedy, for describing a performant rational approximation algorithm.
     25 
     26 License
     27 -----
     28 
     29 Designer Decimal is released under the MIT License. See LICENSE for details.