Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > What should printf infinity show?

Reply
Thread Tools

What should printf infinity show?

 
 
dmoisset@except.com.ar
Guest
Posts: n/a
 
      10-20-2005
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

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      10-20-2005
In article <(E-Mail Removed) .com>,
<(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
Mabden
Guest
Posts: n/a
 
      10-20-2005
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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


 
Reply With Quote
 
pemo
Guest
Posts: n/a
 
      10-21-2005

> In C89, there is no concept of infinity.


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


 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      10-21-2005
"pemo" <(E-Mail Removed)> 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.velocityreviews.com/forums/(E-Mail Removed) <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.
 
Reply With Quote
 
Mabden
Guest
Posts: n/a
 
      10-22-2005
"Keith Thompson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "pemo" <(E-Mail Removed)> 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


 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      10-22-2005
In article <Z9o6f.7054$(E-Mail Removed)> ,
Mabden <mabden@sbc_global.net> wrote:
>"Keith Thompson" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> "pemo" <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Infinity + Infinity (or NegInfinity - NegInfinity) Skybuck Flying C Programming 40 01-25-2012 12:25 AM
What should std::cout << std::numeric_limits<double>::infinity ()print? Stuart Redmann C++ 3 06-04-2010 01:19 PM
Infinity and -Infinity Jon A. Lambert Ruby 3 11-06-2005 04:46 AM
(void) printf vs printf whatluo C Programming 29 09-08-2005 05:42 PM
bus error with printf line included, error without printf line? ben C Programming 4 06-26-2004 04:42 PM



Advertisments