![]() |
Prüfen ob eine Zahl teilbar ist!
Meine Frage ist folgende, ich möchte überprüfen ob man eine Zahl durch eine andere teilen kann (klar thearetisch kann man alles durch alles teilen), also mit ''Teilen'' meine ich das dass Ergebniss glatt ist. z.B.
6 / 3 = 2 (true) 6 / 4 = 1.5 (false)
Delphi-Quellcode:
wie geht das??
if 6/4 = teilbar then
... exception möchte ich vermeiden |
Re: Prüfen ob eine Zahl teilbar ist!
Wie wäre es damit?
Delphi-Quellcode:
if x mod y = 0 then
teilbar else nichtteilbar; |
Re: Prüfen ob eine Zahl teilbar ist!
was bewirkt den mod genau?
|
Re: Prüfen ob eine Zahl teilbar ist!
Zitat:
|
Re: Prüfen ob eine Zahl teilbar ist!
danke meine lieben, tolle sboard tolle user und tolle antowrt :angel:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:23 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz