473,408 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

What should printf infinity show?

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

Nov 15 '05 #1
6 2974
In article <11**********************@g14g2000cwa.googlegroups .com>,
<dm******@except.com.ar> 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
Nov 15 '05 #2
<dm******@except.com.ar> wrote in message
news:11**********************@g14g2000cwa.googlegr 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
Nov 15 '05 #3
In C89, there is no concept of infinity.


What's the *real* one - not wishing to be flip!
Nov 15 '05 #4
"pemo" <us***********@gmail.com> 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) ks***@mib.org <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.
Nov 15 '05 #5
"Keith Thompson" <ks***@mib.org> wrote in message
news:ln************@nuthaus.mib.org...
"pemo" <us***********@gmail.com> 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
Nov 15 '05 #6
In article <Z9*****************@newssvr25.news.prodigy.net> ,
Mabden <mabden@sbc_global.net> wrote:
"Keith Thompson" <ks***@mib.org> wrote in message
news:ln************@nuthaus.mib.org...
"pemo" <us***********@gmail.com> 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
Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pierre Rouleau | last post by:
Hi all, When using Python 2.4.x on a Win32 box, marshal.loads(marshal.dumps(1e66666)) returns 1.0 instead of infinity as it should and does under Python 2.5 (also running on Win32 ). This...
19
by: rahulforfriends | last post by:
can any one plz help me and tell wat heuristic this program of travelling salesman problem is using??? /* C program to demonstrate travelling salesperson problem. */ /* About this...
13
by: kimiraikkonen | last post by:
Hello, I have an aritmetic calculation like this: First note that: i need a "timer" to get the value for value3. (however removing "timer" didn't differ) Dim value1 As Long Dim value2 As...
12
by: naunetr | last post by:
in program below #include <stdio.h> int main() { int id = 123, io = 0123, ih = 0x123; long ld = 1234567L, lo = 01234567l, lh = 0X1234567L; float f = 123.456f; double d = 01234.56789L;
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.