Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'string.': 0.04; 'python': 0.09; 'sat,': 0.15; 'value.': 0.15; 'evaluates': 0.16; 'expression.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'scratch': 0.16; 'wrote:': 0.17; 'string,': 0.17; 'input': 0.18; 'feb': 0.19; '2.x': 0.22; 'int,': 0.22; 'keyboard': 0.22; 'subject:problem': 0.22; 'header:In-Reply-To:1': 0.25; 'in.': 0.27; 'message-id:@mail.gmail.com': 0.27; "i'm": 0.29; 'point': 0.31; 'to:addr:python-list': 0.33; 'that,': 0.34; 'received:google.com': 0.34; 'thanks': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'depends': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'takes': 0.39; 'between': 0.63; 'skip:n 10': 0.63; '2013': 0.84; 'calculations': 0.84; 'etc,': 0.84; 'float,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=Se4+VH2K4W2dCyO8iC18Fo627gsINxDSrneAbYx4XBQ=; b=AiClCZx3134vllm1NGCNq2fcICCLtubi6bJvOQiJQ4ijc1Op8HTeKn3mx6cNCdZGgl qMEkmCk/AhnqNgfk473jLWGrsJ+tC0nUVQQzEMNqqEwx5uW2HfJqZP8sUDOzHOXq6OpQ cd35gXo4N5x0/LwXKGP56TgfidBVhL/FW+hmZlJolvAM3FqN5D0tNj2tvc4RljfsEdEo LFxAn1wES+U2PNB0bsqNMaY5pDCJDL89cQpicJZ6DIEN+RrgIE/aP7N7aDoAWXJZ3bml m0s7n2c/OV19DrprDd/T6bE8tjQZQzTMVIajtcMcwg9hH1xR6LZW6GIna+0KYCvPiqS4 UflQ== MIME-Version: 1.0 X-Received: by 10.229.135.18 with SMTP id l18mr3877068qct.121.1359804012143; Sat, 02 Feb 2013 03:20:12 -0800 (PST) In-Reply-To: References: Date: Sat, 2 Feb 2013 22:20:12 +1100 Subject: Re: Floating point calculation problem From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1359804020 news.xs4all.nl 6886 [2001:888:2000:d::a6]:50507 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38069 On Sat, Feb 2, 2013 at 10:14 PM, Schizoid Man wrote: > Scratch that, I'm not sure which result is right now, so need to look at the > full calculations in details. What would be the difference between > raw_input() and float(input())? > > Thanks again. Depends on what you type in. raw_input() takes a line from the keyboard (handwave) and returns it as a string. input() in 2.X takes a line from the keyboard and evaluates it as a Python expression. float() takes a string, float, int, etc, and returns the nearest-equivalent floating point value. What's the input you're giving to it? ChrisA