Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Christopher Arndt Newsgroups: de.comp.lang.python Subject: Re: [Python-de] Warum liefert // ein float? Date: Thu, 6 Apr 2017 10:12:07 +0200 Lines: 61 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8FvNo10Q2lGMaXvIgCMxg9gcOw2qlbbpv" X-Trace: news.uni-berlin.de Dq14G71deWxxzapVFqf/EwRUBvxq2Xw/IWftsAe0khgA== Return-Path: X-Original-To: python-de@python.org Delivered-To: python-de@mail.python.org X-Virus-Scanned: Debian amavisd-new at mx1.0x20.eu Openpgp: id=F0BA1EAE86651989C0A1C9901E0D97B33A4E1F31 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: X-BeenThere: python-de@python.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Die Deutsche Python Mailingliste List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com de.comp.lang.python:4742 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8FvNo10Q2lGMaXvIgCMxg9gcOw2qlbbpv Content-Type: multipart/mixed; boundary="REqWmIL8mow6DWJUmwQr75ClH2IMEICqw"; protected-headers="v1" From: Christopher Arndt To: python-de@python.org Message-ID: Subject: Re: [Python-de] Warum liefert // ein float? References: In-Reply-To: --REqWmIL8mow6DWJUmwQr75ClH2IMEICqw Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Am 06.04.2017 um 09:52 schrieb Florian Lindner: > Warum liefert // ein float zur=FCck, obwohl das Ergebnis, immer eine ei= ne Ganzzahl ist (in dem Sinne, dass es keine > Nachkommestellen hat)? Der Grund ist die Python Type Coercion. Bei Operationen mit unterschiedlichen Typen der Argumente, werden beide vor der Operation zu einem gemeinsamen, kompatiblen Typ konvertiert, der dann auch den Typ des Ergebnisses bestimmt. Daher auch: 10 // 3 =3D=3D 3 Chris --REqWmIL8mow6DWJUmwQr75ClH2IMEICqw-- --8FvNo10Q2lGMaXvIgCMxg9gcOw2qlbbpv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Puzzled by the all these strange characters? Comment: See http://tinyurl.com/cehoa7 for an introduction Comment: to public key encryption and signing. iQIzBAEBCAAdFiEE8LoeroZlGYnAocmQHg2XszpOHzEFAljl+FcACgkQHg2XszpO HzHecg//ebTue44bLnbzInss7zZE7nkq6umkbXlfsk/t4jfL9oE5XAocPj/GvOVz 7CircytQvjCAG2KNKWccwv9PsntotQX7FbfMwUMuIEm94XRjmxMf1gmI33yMInAM LxM9FRCteAeK50UwWDAKKMWvQyvLAczd3lZDnsarft+HpuUcUYTA59lABin44xAR uJLDoAart/XudiW/epOq71TRFratTMzwC35SwLNi2IBQaMc/O0QiI4+MT8jU/Se4 qEw5Klf+kzpPo2rWHcZzpuzvPqt7/bYbDmyn9HOEsy8zhmir7XGjrb8iZleEqGfc AxEJUWBFue/0Bb8+Si02SDyjPVMl0kq0oiFdNOZfUr67ovBU47crkH4lBtcBq2NK vGjvAa+xRYSpSmHZ5ZrmoRioxLCVq4TZAlOh+UsFmUVye6RvAWlWuK0oMm6RS2sS oovzjIcAYHRymSVOyLtCTIHZyVGkkTQ2fyuQk4DGTQ4eKUTarFakBruXNhS2Qilj rF6G0K22thKTfz7geHF5EQNjCaJYn6XWYBw4v93psUI0mcYNncoBaC0oIJhR6FBl S3i8LR9penqO453rkx8mBWeFMCxklD5g57VnSXAB1ow99oeiqW39wr6zSt3Es8PG e/vjN5tCLpAc/BbK/0PZulnfsogEkdvf8frvjHcPO63ULo2pbPc= =004j -----END PGP SIGNATURE----- --8FvNo10Q2lGMaXvIgCMxg9gcOw2qlbbpv--