    inline int mod(const unsigned short x, const unsigned short m) {
      if (!m) throw CImgArgumentException("cimg::mod(): Specified modulo value is 0.");
      return (int)(x%m);
    }
    inline int mod(const unsigned short x, const unsigned short m) {
      if (!m) throw CImgArgumentException("cimg::mod(): Specified modulo value is 0.");
      return (int)(x%m);
    }