April 7th, 2006

beartato phd

(no subject)

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".