Well, I was guilty of doing something similar about a year ago. A friend asked one evening if it was possible to calculate the compound rate of interest in perl, and I whipped up a program that output a plausible result after 30 years given a certain rate of interest. (Actually I think it was in reverse, given a certain end sum, but anyway)

I had however never used the exponentiation operator in perl (**) and accidentally used the one in Hypertalk (^).

This meant that my program made a bit-wise XOR instead of a rate of interest for each year. It alll become clear when we printed the increase in wealth per annum, which was kind of jerky, to say the least :-)

/jeorgen


In reply to RE: There's more than one way to do it . . . by accident by jeorgen
in thread There's more than one way to do it . . . by accident by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.