MLUG: Re: [UUG/MLUG] perl and %
Re: [UUG/MLUG] perl and %
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Thu, 6 Jan 2000, Stephen Montgomery-Smith wrote:

> I gotta say that this thread was really informative for me.  I guess
> that I had never read the docs, and had always assumed that % did
> things the wrong way, like C.  

So here are the data points I now have:

Language     mod is "broken"

C            yes
gawk         yes
postscript   yes (well, at least gs)
bc           yes (bleah!)
hugs/haskell yes (double bleah!)
matlab       no?
perl         no
python       no
tcl          no

Where "broken" just means that it gives a result that would displease a
mathematician.  The fact that my version of a haskell interpreter blows
this is pretty depressing.

I also question the matlab result, because I really can't see a reason why
it shouldn't barf on, e.g., mod(12,0) rather than just answer 12 (which is
what it does).

I don't have easy access at this moment to S-plus (or R, it's clone),
or mathematica, but I'd be stunned if they did it wrong.  Dunno about
php, javascript, java, or anything else that might be relevant.

So I suppose the lesson here is: Caveat modulor (or something like that).

jking