J
jacob navia
Marco said:I'm curious. What does your machine print for 6.0221415e23 ?
The same as 6.0221415e23+0.5
Interesting no?
Marco said:I'm curious. What does your machine print for 6.0221415e23 ?
jacob said:The same as 6.0221415e23+0.5
Interesting no?
That can't work because (as I said before) long longMarco said:I mean when it comes out of RoundMyDouble
On Thu, 22 Nov 2007 09:12:02 +0000 in comp.lang.c++, Richard
But saying that "double &value" is illegal doesn't "work" in c.l.c++
Richard said:David Harmon said:
Touche'. Nevertheless, agreeing that it's legal doesn't work in clc.
Richard said:jacob navia said:
Here is an approximation of pi * (10 to the power 60), that I have
truncated at the sixtieth decimal place.
3141592653589793238462643383279502884197169399375105820974944.
592307816406286208998628034825342117067982148086513282306647
If we round to forty decimal places, we get:
3141592653589793238462643383279502884197169399375105820974944.
5923078164062862089986280348253421170680
What makes you think this "has no sense"?
That can't work because (as I said before) long long
has only 18 digits (or similar)
Rounding has no sense with values that large.
Richard said:jacob navia said:
People who don't wish to mislead to OP by giving incorrect advice.
<spam snipped>
Who cares?
And you will tell me that you used double precision of course.
Richard said:jacob navia said:
Richard Heathfield wrote:
David Harmon said:
On Thu, 22 Nov 2007 09:12:02 +0000 in comp.lang.c++, Richard
Right - but of course a cross-posted article should "work" in all
the groups into which it's posted.
But saying that "double &value" is illegal doesn't "work" in c.l.c++
Touche'. Nevertheless, agreeing that it's legal doesn't work in
clc.
Who cares?
People who don't wish to mislead [the] OP by giving incorrect advice.
<spam snipped>
Incorrect advice happens only when they read your posts.
Richard said:jacob navia said:
I was answering your specific point that "Rounding has no sense with values
that large", by demonstrating that rounding does indeed "have sense" even
with values trillions of times larger. You still have not explained why
you think it "has no sense".
Your latest question is a non sequitur. In any case, C does not place any
upper limit on the precision of double precision floating point values.
Incorrect advice happens only when they read your posts.
Walter said:Incorrect advice also happens when people read some of *my* posts,
so your "only" would appear to be incorrect.
I don't know of -any- poster here who has a perfect advice posting
record (though some average much higher quality than others.)
Can't you read THE SUBJECT OF THIS THREAD!!!
"Rounding double"
You know what DOUBLE means?
This thread is about rounding double precision numbers,
and your multi precision is off topic in this thread!
It is NOT "rounding in general to 50 decimal places" it
is "Rounding double" OK?
Who is saying anything about "C in general" ???
Can't you read THE SUBJECT OF THIS THREAD!!!
"Rounding double"
You know what DOUBLE means?
This thread is about rounding double precision numbers,
and your multi precision is off topic in this thread!
NOTE THE SUBJECT HEATHFIELD!
It is NOT "rounding in general to 50 decimal places" it
is "Rounding double" OK?
Richard said:I'm talking about double-precision numbers. You appear to believe that C
specifies a particular precision for double. It does not. It specifies
only a minimum precision that any implementation must provide, but it
imposes no maximum precision. Implementations are free to provide a
thousand digits of precision if they wish, or even more.
I have done so.
I am aware of that. What makes you imagine that C forbids 50 or more
decimal places of precision for doubles?
Walter said:"double" is a C datatype defined by the C standards in terms
of *minimum* capacity.
I know of at least one system in which double has a 107 bit mantissa,
which is approximately 34 decimal digits.
And there are others that do not give ANY solution,
limiting themselves to say why the solutions presented in some
cases not asked for would not work
I used the original solution and fixed it for double
precision, it is surely not the best solution.
But instead of proposing a better solution this people limit
to talking nonsense without ever proposing anything else.
Then I get angry start getting mad at heathfield and this
degrades.
I do not know which "C" you are talking about. I am talking about
the C as defined by the C99 standard which says in the
Annex F (normative)
<quote>
The C floating types match the IEC 60559 formats as follows:
— The float type matches the IEC 60559 single format.
— The double type matches the IEC 60559 double format.
<end quote>
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.