True Division in Python

Discussion in 'Python' started by kermit@polaris.net, Dec 6, 2006.

  1. Guest

    For a long time,, There has been a discussion of trueFor division
    versus integer division in Python.


    I myslef prefer that / be used for integer division since almost
    always, I want the result of the
    division be truncated to integer.

    However, today I reviewed the method to be used in Python to get true
    division, and this gave
    me an idea how true division could be implemented without interferring
    with the use of

    / for integer division.

    Use / for integer division

    single slash is the operator for integer division.

    Use ./ for true division.

    period slash is the operator for true division.

    Kermit < >
    , Dec 6, 2006
    #1
    1. Advertising

  2. Kleine Aap Guest

    wrote:

    > Use ./ for true division.


    syntax error...
    Kleine Aap, Dec 7, 2006
    #2
    1. Advertising

  3. Terry Reedy Guest

    <> wrote in message
    news:...
    > For a long time,, There has been a discussion of trueFor division
    > versus integer division in Python.


    The discussion and the decision to use // and / were years ago.

    > I myslef prefer that / be used for integer division since almost
    > always, I want the result of the
    > division be truncated to integer.


    So use //

    > However, today I reviewed the method to be used in Python to get true
    > division, and this gave
    > me an idea how true division could be implemented without interferring
    > with the use of
    > / for integer division.
    > Use / for integer division
    > single slash is the operator for integer division.
    > Use ./ for true division.
    > period slash is the operator for true division.


    Proposing to use / and ./ instead of // and / is a waste of time. Really

    Terry Jan Reedy
    Terry Reedy, Dec 7, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Siemel Naran

    Does true ^ true return false?

    Siemel Naran, Jun 17, 2004, in forum: C++
    Replies:
    19
    Views:
    661
    Chris Theis
    Jun 18, 2004
  2. Chip
    Replies:
    6
    Views:
    2,631
    E. Robert Tisdale
    Jan 8, 2005
  3. Replies:
    18
    Views:
    459
    Magnus Lycka
    Feb 20, 2006
  4. Replies:
    94
    Views:
    4,483
    ┬Ča\\/b
    Feb 9, 2007
  5. bdb112
    Replies:
    45
    Views:
    1,339
    jazbees
    Apr 29, 2009
Loading...

Share This Page