Jason (jcreed) wrote,
Jason
jcreed

So I pretty much had already lost respect for Perl, but now I hardly even trust it for writing hilariously bad code that computes its answer in a very large amount of time. For when I try to write merely hilariously bad code, I get tragically bad code that doesn't even compute the right value, in a very large amount of time.

The semantics of the boundary where integer arithmetic overflows into floating point apparently changed between versions 5.8.7 and 5.8.8. Code that happily computed 32-bit modular addition and multiplication in the former does not in the latter. I can write code that "works" for both, except that I'm not sure it really works, and it uses floating point mod. Ugh ugh ugh. And "use integer" is not to be trusted, since on a 64-bit machine, it does 64-bit modular arithmetic. "If it [the compiler]", and I am quoting the perlop manpage, "feels like it".
Tags: perl, programming, sux0rz
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 16 comments