Unary +

  • Thread starter karthikbalaguru
  • Start date
K

Keith Thompson

Dik T. Winter said:
Why then did you ask your question in response to something that was
about floating-point? Did you actually *read* the line before
"a + (b - a) can not be rearranged at all"?

Chuck is often criticized for not reading an entire thread before
responding, so it's only fair to point out that he acknowledged
his error:

| > So you didn't see the phrase "and so in floating-point" in Dik's
| > article? You even quoted it.
|
| Because I didn't pay attention. Sorry.

more than 11 hours before you posted.
 
D

Dik T. Winter

>
> Chuck is often criticized for not reading an entire thread before
> responding, so it's only fair to point out that he acknowledged
> his error:
>
> | > So you didn't see the phrase "and so in floating-point" in Dik's
> | > article? You even quoted it.
> |
> | Because I didn't pay attention. Sorry.
>
> more than 11 hours before you posted.

Indeed, I did not read the entire thread before posting. What I was
criticising was that Chuck does not only not read entire threads but
also not the articles he is responding to.

But the criticism to Chuck is stronger. He often posts answers to
articles in a thread without reading anything that is posted later
*or earlier*. He even does admit this.
 
G

Guest

Keith Thompson wrote:


If you consider floats to be approximations, then so are integers.

I don't see this
Each
can represent a large set of values exactly, and approximate all others.

what values are approximated by, say, 2?
The set of values a float can represent exactly is merely different than
that for an integer. Some processor architectures even refer to the
integer unit as the fixed-point unit.

which bit of "fixed-point unit" implies approximation?

<snip>
 
J

James Kuyper

I don't see this


what values are approximated by, say, 2?

What an integer represents is determined by the designer of the program.
In many contexts, 2 means only and exactly 2. In other contexts, 2 is an
approximation to any value x such that 1.5<=x && x<2.5. In other
contexts, it represents any value x such that 1.5<x && x<=2.5. In other
contexts, 2 represents any value x such that sqrt(1.0*2.0) <= x && x <
sqrt(2.0*3.0). There's many other possibilities as well.

The key difference between integer and floating point values is that it
is extremely common to use integers in ways in which they represent only
the exact value that they have, rather than approximations to a range
of values, while use of integers to represent a range of values is not
uncommon.

With floating point types, they must almost always be considered as
approximations to a range of values; exceptions are rare, and are
usually due to ignorance of how floating point math is handled, rather
than a deliberate design choice.
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,224
Latest member
BettieToom

Latest Threads

Top