fabien van mook

all packages "fvm-*"

package "fvm-miscellaneous"

function file "moddiff.m"

Function c = moddiff(a,b,m)

returns the difference b minus a by intermediation of
modulo m.

Input arguments a and b are numerical matrices. Each
element in a is compared in pair-wise manner with the
corresponding element in b. The rules of broadcasting are
applied in this process.

The function is also useful to calculate the signed
difference between two angles. E.g. for angles in degrees:
  moddiff(a,b,360)


(c) 2026 fabien van mook

2026.08.20 release of this file within package "fvm-miscellaneous" under GNU GPLv3+