Paul is mostly correct. Where he is wrong is that 3dcalc is programmed
not to produce NaN or other illegal outputs. So sqrt() of a negative number will return 0, not the NaN (Not a Number) marker for an illegal value. Similarly, log() of a negative number returns 0. Getting a dataset full of NaN values would be a bad thing, so the program won't do it.
3dcalc is a general purpose voxel-wise calculator. It has a lot of functions that are of little daily use in FMRI -- but you have to recall that I'j a mathematician, and mathematical functions are just plain
fun for me. I'd say my favorite is J0(x), which is a
Bessel function -- something I spent a couple of months (at least) studying back in the good old days. As far as I know, Bessel functions don't have any use in FMRI (although they do arise in the theory of spiral MRI pulse sequences). So why is J0(x) in 3dcalc? Because I want it to be.