Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38069

Re: Floating point calculation problem

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 <rosuav@gmail.com>
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 <keisev$7v1$1@dont-email.me>
References <keipl5$kif$1@dont-email.me> <mailman.1289.1359801291.2939.python-list@python.org> <keisev$7v1$1@dont-email.me>
Date Sat, 2 Feb 2013 22:20:12 +1100
Subject Re: Floating point calculation problem
From Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1291.1359804020.2939.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Sat, Feb 2, 2013 at 10:14 PM, Schizoid Man <schiz_man@21stcentury.com> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Floating point calculation problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-02 10:27 +0000
  Re: Floating point calculation problem Chris Angelico <rosuav@gmail.com> - 2013-02-02 21:34 +1100
    Re: Floating point calculation problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-02 11:14 +0000
      Re: Floating point calculation problem Chris Angelico <rosuav@gmail.com> - 2013-02-02 22:20 +1100
        Re: Floating point calculation problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-02 11:34 +0000
          Re: Floating point calculation problem Chris Angelico <rosuav@gmail.com> - 2013-02-02 22:38 +1100
            Re: Floating point calculation problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-02 11:51 +0000
              Re: Floating point calculation problem Chris Angelico <rosuav@gmail.com> - 2013-02-02 22:58 +1100
                Re: Floating point calculation problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-02 15:48 +0000
                Re: Floating point calculation problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-02 15:54 +0000
                Re: Floating point calculation problem Chris Angelico <rosuav@gmail.com> - 2013-02-03 03:00 +1100
                Re: Floating point calculation problem Michael Torrie <torriem@gmail.com> - 2013-02-02 11:19 -0700
                Re: Floating point calculation problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-03 12:25 +1100
                Re: Floating point calculation problem Dave Angel <d@davea.name> - 2013-02-02 21:20 -0500
                Re: Floating point calculation problem Michael Torrie <torriem@gmail.com> - 2013-02-02 21:22 -0700
              Re: Floating point calculation problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-02 23:11 +1100
      Re: Floating point calculation problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-02 22:45 +1100
        Re: Floating point calculation problem "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-02 11:50 +0000
  Re: Floating point calculation problem Chris Rebert <clp2@rebertia.com> - 2013-02-02 02:47 -0800
  Re: Floating point calculation problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-02 23:05 +1100

csiph-web