Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Hermann Riemann Newsgroups: de.comp.lang.python Subject: Re: -1//2 Date: Fri, 11 Apr 2025 06:27:31 +0200 Lines: 18 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 6yNub8KGK3mV4Gyp2yBVtgn795+Crkla6bRMgrTySBgs6sAE3O Cancel-Lock: sha1:XxjgbKAd17R4op55fUVxUb++Y6A= sha256:QCsLW+HuGjzjWKnmI1xNAGTqMX2Ir0K6kZBd34MRxw0= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 In-Reply-To: Content-Language: de-DE Xref: csiph.com de.comp.lang.python:6290 Am 10.04.25 um 17:02 schrieb Peter Heitzer: > Hermann Riemann 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. --