Bestimmung ob eine zahl ungerade ist oder nicht in C# Ohne Modulo?

1 Antwort

bool istGerade (int Zahl) {
  double Ergebnis = ((double)Zahl) / 2;
  int Ergebnis2   = Zahl / 2;
  return (Ergebnis == Ergebnis2);
}

Mit dieser Funktion geht es. Aber warum ohne Modulo ?