Local maximum/minimum in grdmath

I would like to know how exactly the local maximum/minimum is estimated from a grid file using grdmath?

/Seny

It is using centered finite differences for computing the derivatives inc and y directions, and also diagonally to make sure we can tell highs from lows. If your data is very noisy you will find lots of these extrema, but if smooth it will flag the ones you have. If noisy you will want to filter first.