How Do You Pronounce char?

I

Ido Yehieli

As integers, try 1, 3, 0. If you want exact values you are out of
luck, even if the machine has floats, doubles, etc. of any finite
size. However you can represent 1/3 as a rational.

My point was that a float doesn't represent a real number, in fact it
doesn't even represent a rational number.

-Ido.
 
M

Malcolm McLean

Ido Yehieli said:
My point was that a float doesn't represent a real number, in fact it
doesn't even represent a rational number.
They are rational numbers. Just not the ratio you passed in as decimal.
 
M

Mark McIntyre

Malcolm said:
They are rational numbers. Just not the ratio you passed in as decimal.

You misunderstood - the prev poster was pointing out that you can't use
floats to represent rational numbers. 1/3 was an example.
 
M

Morris Dovey

Ido said:
But it isn't. How do you represent sqrt(2), pi or even the rational
fraction 1/3? A float is a floating point number, not a real number.

Just as you would if you were using a pencil and paper to show
the values - as rational approximations using a representation
radix.
 
B

Ben Bacarisse

Mark McIntyre said:
You misunderstood -

Then I misunderstood as well. As far as I can see, Ido Yehieli made a
statement that needed to be corrected. If a float does not represent
a real (and all do) and "it does not even represent a rational
number" then I puzzled about what is does represent.

This is so wrong that I suspect a language issue. "a float" and "it"
suggest one instance of the type float, but Ido probably wanted to
talk about the type float and the set of rationals. "The float type
does not represent the set of reals, in fact it does not even represent
the rationals" is much more likely what was meant.
the prev poster was pointing out that you can't
use floats to represent rational numbers.

You can't mean that, surely. Did you mean to say "... *all* rational
numbers", i.e. that the values of type float represent a very small
subset of the rationals?
 
M

Malcolm McLean

Ben Bacarisse said:
Then I misunderstood as well. As far as I can see, Ido Yehieli made a
statement that needed to be corrected. If a float does not represent
a real (and all do) and "it does not even represent a rational
number" then I puzzled about what is does represent.
If represents a number, or not a number, depending on what isnan() returns.
So floats certainly are not a subset of the rationals.
 
M

Mark McIntyre

Ben said:
Then I misunderstood as well.

Yes.

As far as I can see, Ido Yehieli made a
statement that needed to be corrected.

I think he made a statement you misunderstood. He was saying that the
float type is incapable of representing real numbers in general.

If a float does not represent
a real (and all do)

Represent 0.11111111 recurring exactly in IEEE floating point.

and "it does not even represent a rational
number" then I puzzled about what is does represent.

It represents a subset of reals , and a smaller subset of rationals.
This is so wrong that I suspect a language issue.

I don't agree. In many languages, the impersonal and singular pronouns
are commonly used to represent generalised ideas. On fait quelquechose.
Er geht.

"The float type
does not represent the set of reals, in fact it does not even represent
the rationals" is much more likely what was meant.

Yes, I think thats exactly what he meant.
You can't mean that, surely. Did you mean to say "... *all* rational
numbers", i.e. that the values of type float represent a very small
subset of the rationals?

That's what I said. Apparently nobody here did basic logic at school.
 
C

CBFalconer

Mark said:
You misunderstood - the prev poster was pointing out that you
can't use floats to represent rational numbers. 1/3 was an example.
^-- binary ^-- all

Correct as above.
 
B

Ben Bacarisse

Malcolm McLean said:
If represents a number, or not a number, depending on what isnan() returns.
So floats certainly are not a subset of the rationals.

You are quite right that some floating point representations include
values that are not in the set of reals.
 
B

Ben Bacarisse

Mark McIntyre said:
Ben Bacarisse wrote:

Yes, I think thats exactly what he meant.

We are all agreed then.
That's what I said. Apparently nobody here did basic logic at
school.

Do you answer "yes" when asked if you want red or white?
 
U

user923005

Do you answer "yes" when asked if you want red or white?

Well, it would be correct unless he wanted some other color.

Supposedly a true story:
A certain mathematician had the habit of simply writing answers to
homework assignments on the board (the method of solution being, of
course, obvious) when he was asked how to solve problems. One time one
of his students tried to get more helpful information by asking if
there was another way to solve the problem. The mathematician looked
blank for a moment, thought, and then answered, "Yes".

The following is a fairly classical mathematics joke:
Q: What does a mathematicians answer, when you ask him/her if (s)he
wants
the window open or closed?
A: Yes.
 
P

Peter 'Shaggy' Haywood

Groovy hepcat Kenneth Brody was jivin' in comp.lang.c on Wed, 30 Jan
2008 3:09 am. It's a cool scene! Dig it.

[Snip.]
Didn't this exact question come up a few months ago?

Oh, this comes up every now and then. Just tell them to pronounce
"char" as "crap". It makes sense when you spell it out phonetically.
It's like this:

c as in "crap"

h as in "crap" (ie., silent, since there's no h in "crap")

a as in "crap"

r as in "crap"

Therefore, "char" is pronounced "crap".
 
F

Flash Gordon

CBFalconer wrote, On 31/01/08 23:50:
^-- binary ^-- all

Correct as above.

C allows the float to be decimal and it *still* can't represent all
rational numbers. So you are correct to all "all" but adding "binary" is
a needless restriction.
 
U

user923005

CBFalconer wrote, On 31/01/08 23:50:



C allows the float to be decimal and it *still* can't represent all
rational numbers. So you are correct to all "all" but adding "binary" is
a needless restriction.

For that matter, neither can short, int, long nor even long long
represent all integers. The fraction that is representible as a ratio
to the entire set is zero.
 
C

CBFalconer

Flash said:
CBFalconer wrote, On 31/01/08 23:50:

C allows the float to be decimal and it *still* can't represent all
rational numbers. So you are correct to all "all" but adding
"binary" is a needless restriction.

Not so. What if the float significand etc. used base 3, or 6, or
9? Then 1/3 could be expressed exactly. "binary" is needed. I
can find nits anywhere. :)
 
F

Flash Gordon

CBFalconer wrote, On 02/02/08 00:20:
Not so. What if the float significand etc. used base 3, or 6, or
9? Then 1/3 could be expressed exactly. "binary" is needed. I
can find nits anywhere. :)

Still could not represent all rational numbers :)
If you want you could specify that 1/3 was an example for binary/decimal.
 
M

Morris Dovey

Flash said:
Still could not represent all rational numbers :)
If you want you could specify that 1/3 was an example for binary/decimal.

Is this a hobby thread? This isn't a C issue, or even a computing
issue - it's fairly obvious that only a tiny subset of all
possible values can be exactly represented by a number with a
finite sequence of digits, no matter how that sequence is formed.

The horse is not alive. :)
 
T

TerryP

Billy said:
How is the Standard C type char pronounced?

I always assumed it was short for character and should be pronounced like
the char in character.

Recently we had a guy work for us who pronounced it like the char in
charcoal.

How do you pronounce char?

I can't say for the rest of the human race but I generally have two
pronunciations of every word. What I say in my mind and what comes out of
my mouth.

For the identifiers that are not true English words, my pronunciation is a
mixture of what they are mnemonic for and how they sound in my head.


char as in character, sounds a bit like 'cah-hair' some times to me but
could be the accent.

int as in "in it" because 'in teg er' would be longer for my tongue.

const as in constant minus ant.

#ifndef, usually 'if not deaf' or 'if na deaf' depending on how fast I say
it or *think* it.

#elif as 'el if', eg. I pronounce the el as an L, a habit of mine when
learning a new language is to figure out if it's else if; elif, elseif, or
drunk of the month club.


I've never paid much attention to it since it is rare I get to speak to any
one that knows the difference between a compiler and trash compactor. Hey
wait some times they do both ^_^.
 

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,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top