Residue class rings of real-analytic and entire functions