Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Float Date: Sat, 30 Jul 2016 21:51:29 +1000 Lines: 26 Message-ID: References: <579b67b0$0$1614$c3e8da3$5496439d@news.astraweb.com> <367666cb-224f-4b16-88bb-cd1ada13a13b@googlegroups.com> <579c82a6$0$1619$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de qOTO48QbnCmq36DG4BZXOgBPJrDd/UnOkMP8I8zB2ysg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.036 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'cc:addr:python-list': 0.09; '*is*': 0.09; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'integer': 0.18; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'number)': 0.22; 'sat,': 0.23; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; '3.0': 0.27; 'context,': 0.29; 'convert': 0.29; 'computing': 0.32; 'point': 0.33; 'int': 0.33; 'equal': 0.34; 'received:google.com': 0.35; 'but': 0.36; '(and': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'represent': 0.38; 'data': 0.39; '30,': 0.63; 'float:': 0.72; 'jul': 0.72; 'incredibly': 0.76; 'chrisa': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=IOtjcV0jJTienbRHHIenV5vZX/vki/jD5Lw/X0NONb4=; b=CrK5T8zSJZBtD9OY4K5hhQkLGLtnItHEOnlipkUZXTX+4W7jpGShmpKYZUsc0ZlshY yWINT5+9QpwWn1Gz9M3jyKaULAMiSS2SmUA6Weh2vg3g3EuBEhT17DRx78kvAGuYo8fz ytu8d4pwlPTf2JUFi57I6E8A5PN/gDMnUNVrRYLJzyahSjK5xpCZ+hLg2bd+mbhUuZs3 lifYFobQk7doAPTxGiEtNz2uoo1O4oYxqhg0ldLVjJhj+v0RzoTHh2z8Aau3w3AbCaOG UEu8dlsqGCuOnedOlpnwuBHLvjG4sCzLVggxKEggnICL2N7DpXp0U9dcX4fNeD2/Z3SP 3ztg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=IOtjcV0jJTienbRHHIenV5vZX/vki/jD5Lw/X0NONb4=; b=UxhfKlo2hOAp953G6qL8NLnnjFQbBCgQi4XBEaZarVRbQd/uMfjh1p8X5yEx/CiDtZ NgVvMPeg2zTOAmdi1xb22Uf9MMal8qGKkoyJZy2a/uqYvn634mG4ZQb+hRFxfAToJlxV 60Gireo5797qAM1nw0uOENp7CwgIs9ge1CHGfPskQhpKHXZBzX7RnJJ3ABHI6yentisN sWVETi8Pb7cVhbS92qt48oeVl6XziwWasizypJoFTMLLmLdM/nEYfxYGFuAttl//Q0x4 BcMsmTvbuJtlwrueElVh+Cfpv9vBVgq+OaJbNYOSU+XEtM3bUKIZ6B40Ul6sEX7p6kP+ 8Npg== X-Gm-Message-State: AEkoouthA3CDEE238sdWTNTwm3LyuzZynB4VknqJqz8/2h3H+PWx5mHvuU1ujv6Bshrbmy06y0A3HNUUBQQazA== X-Received: by 10.28.50.199 with SMTP id y190mr5287441wmy.61.1469879489934; Sat, 30 Jul 2016 04:51:29 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <579b67b0$0$1614$c3e8da3$5496439d@news.astraweb.com> <367666cb-224f-4b16-88bb-cd1ada13a13b@googlegroups.com> <579c82a6$0$1619$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:112056 On Sat, Jul 30, 2016 at 9:44 PM, Cai Gengyang wrote: > You mentioned that : A floating point number[2] is number that is not an integer (and not a > complex number) > > Hence , > > 10 is not a floating point number because it is an integer > 25 is not a floating point number because it is an integer > 7 + 3i is not a floating number because it is a complex number > 8 + 5i is not a floating number because it is a complex number. > > Is 3.0 a floating number ? It is a rational number, not an integer right ? In a computing context, data types are incredibly significant. So yes, 3.0 *is* a floating-point number. It's equal to the integer 3, because they represent the same number, but it's not identical to it. You can convert from one to the other with the built-ins int and float: >>> 3.0 == 3 True >>> int(3.0) 3 >>> float(3) 3.0 ChrisA