Hermann Riemann <nospam...@hermann-riemann.de> wrote:
>Am 10.04.25 um 17:02 schrieb Peter Heitzer:
>> Hermann Riemann <nospam...@hermann-riemann.de> 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, peter.heit...@rz.uni-regensburg.de
_______________________________________________
python-de Mailingliste -- python-de@python.org
Zur Abmeldung von dieser Mailingliste senden Sie eine Nachricht an 
python-de-le...@python.org
https://mail.python.org/mailman3/lists/python-de.python.org/
Mitgliedsadresse: arch...@mail-archive.com

Reply via email to