Hermann Riemann <[email protected]> wrote: >Am 10.04.25 um 17:02 schrieb Peter Heitzer: >> Hermann Riemann <[email protected]> wrote: >>> Das Ergebnis von -1//2 ist laut Python3 -1 >>> Wegen Vorzeichen shift? >> Der Operator // macht eine Floor Division und math.floor(-0.5) ergibt >> -1. >> Siehe dazu PEP238 https://peps.python.org/pep-0238/
>Floor ist floating point. >-1, 2, // soll alles integer sein. >-1//2==-(1//2) >liefert False >Sieht mir ungewohnt aus. floor(0.5) (1//2) ist halt 0 und floor(-0.5) (-1//2) ergibt -1. -- Dipl.-Inform(FH) Peter Heitzer, [email protected] _______________________________________________ python-de Mailingliste -- [email protected] Zur Abmeldung von dieser Mailingliste senden Sie eine Nachricht an [email protected] https://mail.python.org/mailman3/lists/python-de.python.org/ Mitgliedsadresse: [email protected]
