What should printf infinity show?

Discussion in 'C Programming' started by dmoisset@except.com.ar, Oct 20, 2005.

  1. Guest

    Hi,
    I'm looking for a standard definition about what should {printf
    ("%f", x)} do when x is INFINITY...
    I've found that in ISO C99 the output should be "inf" or
    "infinity", but I was wondering if something is said about this in
    older standards.

    Any pointer? Thanks,

    Daniel
    , Oct 20, 2005
    #1
    1. Advertising

  2. In article <>,
    <> wrote:
    > I'm looking for a standard definition about what should {printf
    >("%f", x)} do when x is INFINITY...
    > I've found that in ISO C99 the output should be "inf" or
    >"infinity", but I was wondering if something is said about this in
    >older standards.


    In C89, there is no concept of infinity. The only reference
    to the IEEE standard that I can find in C89 is in the description
    of <float.h>, where it lists some sample limits "that also meet"
    the IEEE standards.
    --
    If you lie to the compiler, it will get its revenge. -- Eric Sosman
    Walter Roberson, Oct 20, 2005
    #2
    1. Advertising

  3. Mabden Guest

    <> wrote in message
    news:...
    > Hi,
    > I'm looking for a standard definition about what should {printf
    > ("%f", x)} do when x is INFINITY...
    > I've found that in ISO C99 the output should be "inf" or
    > "infinity", but I was wondering if something is said about this in
    > older standards.
    >
    > Any pointer? Thanks,


    A grand master said, "With uniform equanimity, everything disappears of
    itself."

    This is the oldest teaching I could find quickly.

    HTH. HAND.

    --
    Mabden
    Mabden, Oct 20, 2005
    #3
  4. pemo Guest


    > In C89, there is no concept of infinity.


    What's the *real* one - not wishing to be flip!
    pemo, Oct 21, 2005
    #4
  5. "pemo" <> writes:
    >> In C89, there is no concept of infinity.

    >
    > What's the *real* one - not wishing to be flip!


    What's the real what?

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
    Keith Thompson, Oct 22, 2005
    #5
  6. Mabden Guest

    "Keith Thompson" <> wrote in message
    news:...
    > "pemo" <> writes:
    > >> In C89, there is no concept of infinity.

    > >
    > > What's the *real* one - not wishing to be flip!

    >
    > What's the real what?


    Oh, Keith. Why must you control and contain every question? You want to
    bring it into your world and change it into something you can understand
    in order to convince everyone you have all the answers.

    The obvious answer to the poster is simply this; "expect nothing, seek
    nothing, and grasp nothing."

    --
    Mabden
    Mabden, Oct 22, 2005
    #6
  7. In article <Z9o6f.7054$>,
    Mabden <mabden@sbc_global.net> wrote:
    >"Keith Thompson" <> wrote in message
    >news:...
    >> "pemo" <> writes:
    >> >> In C89, there is no concept of infinity.


    >> > What's the *real* one - not wishing to be flip!


    >> What's the real what?


    >Oh, Keith. Why must you control and contain every question? You want to
    >bring it into your world and change it into something you can understand
    >in order to convince everyone you have all the answers.


    -I- (not Keith) was the person who wrote, "In C89, there is no
    concept of infinity.", and thus -I- was the one being asked,
    "What's the *real* one". And you know, Mabden, -my- reaction when
    I read that question was, "Huh?? What is this person trying to say?
    What's the real -what-??".

    When I read the "What's the *real* one" question, I thought about
    it for a moment, thought about a few possible answers, and then flagged
    the posting in my newsreader to return to it at a later time when
    I would once more try to figure out what the person was really trying
    to ask, and what the answers to that question would be, and to give
    me time to decide whether (considering how busy I am lately) whether
    I wanted to go the route of, "Well, you might have meant this, and the
    answer for that is Foo, but you might have meant that, and the
    answer for that is Bar, but you might have meant this other thing and
    the answer to that is Baz..." I was the one being asked the question,
    but I did not reply promptly because the question was so difficult
    to answer -as stated- that it was going to take a lot of thought to
    decypher.

    Then Keith posted his succinct "What's the real what?" response, and
    I looked at it and said, "Why yes, that will do; it sums up nicely
    what I would have ended up saying" -- so I decided not to add my
    confusion to the mix.

    As far as -I- am concerned, Keith did not in any way attempt to
    control or contain the question: he just didn't understand it, and
    asked for clarification, which would have been the same thing I
    likely would have ended up doing.


    > The obvious answer to the poster is simply this; "expect nothing, seek
    > nothing, and grasp nothing."


    The poster said "not meaning to be flip", and in -my- opinion the
    response you propose is flip and unamusing -- and philosophically
    suspect. The Masters say, "Concentrate entirely on the moment,
    and do the best you can at whatever is in front of you."
    --
    I was very young in those days, but I was also rather dim.
    -- Christopher Priest
    Walter Roberson, Oct 22, 2005
    #7
    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. ben
    Replies:
    4
    Views:
    600
    Martin Ambuhl
    Jun 26, 2004
  2. whatluo

    (void) printf vs printf

    whatluo, May 26, 2005, in forum: C Programming
    Replies:
    29
    Views:
    1,225
  3. Stuart Redmann
    Replies:
    3
    Views:
    1,142
    Victor Bazarov
    Jun 4, 2010
  4. Skybuck Flying

    Infinity + Infinity (or NegInfinity - NegInfinity)

    Skybuck Flying, Oct 8, 2011, in forum: C Programming
    Replies:
    40
    Views:
    1,677
    Tim Rentsch
    Jan 25, 2012
  5. Jon A. Lambert

    Infinity and -Infinity

    Jon A. Lambert, Nov 5, 2005, in forum: Ruby
    Replies:
    3
    Views:
    323
    Trans
    Nov 6, 2005
Loading...

Share This Page