pow(2, 1/2) != pow(2, 0.5) problem

M

Mark McIntyre

No. Tell someone on the street that 1/2 equals 0.

Q: "Man in Street, you have one live human. You divide them in two.
How many live humans do you have? "

A "Zero live humans"
The inexact nature of floating point numbers is a different issue.

I think the point was, its all to do with expectations.

On the other hand, if for
instance 1/2 = 0 it's not division, it's something else.

You're incorrect, its perfectly valid division of integers.
 
M

Mark McIntyre

On 16 Jun 2005 07:37:01 GMT, in comp.lang.c ,
Apparently the horizontal fraction bar ('vinculum') was hard to
print mechanically.

Yes indeed, it either took up three rows, or required smaller
typeface, or special extra blocks. Expensive.
 
M

Michel Rouzic

It is also commonly used for dates in the UK and the USA -- 16/6/2005 in
the UK, 6/16/2005 in the USA for todays date (2005-06-16 in ISO 8601).
Which, of course, is just as irrelevant to how it is used in C...

Chris C

hehe dont worry, its commonly used for dates anywhere in the world,
except maybe on planet ISO 8601
 
A

Anonymous 7843

hehe dont worry, its commonly used for dates anywhere in the world,
except maybe on planet ISO 8601

And I'm quite miffed that there is no stardate conversion
specifier for strftime.
 
G

Gordon Burditt

hehe dont worry, its commonly used for dates anywhere in the world,
And I'm quite miffed that there is no stardate conversion
specifier for strftime.

Is there a known formula for that which all Trekkies will agree on?
There is a problem with the common Unix 32-bit time_t implementation,
which runs out in 2106 (if you make it unsigned) or 2038 (if it's
signed). However, nothing in ANSI C says time_t has to be 32 bits.

Gordon L. Burditt
 
O

Old Wolf

Gordon said:
Is there a known formula for that which all Trekkies will agree on?
There is a problem with the common Unix 32-bit time_t implementation,
which runs out in 2106 (if you make it unsigned) or 2038 (if it's
signed). However, nothing in ANSI C says time_t has to be 32 bits.

Nothing says it has to be an integral type. I've seen
implementations where it is a double, and implementations
where it is a struct.
 
J

Joe Wright

Gordon said:
Is there a known formula for that which all Trekkies will agree on?
There is a problem with the common Unix 32-bit time_t implementation,
which runs out in 2106 (if you make it unsigned) or 2038 (if it's
signed). However, nothing in ANSI C says time_t has to be 32 bits.

Gordon L. Burditt

And nothing to say it must be integral seconds. Why not double? With
53-bit precision and 2 ^ +-1024 range, we should have interesting times
pretty well covered, from millions of years to small fractions of
nanoseconds.

And I'm the first to think about and suggest double for time_t, right?
I'm going to the bar for a fresh drink. Y'all get together and tell me
why it won't work.
 
K

Keith Thompson

Old Wolf said:
Gordon Burditt wrote: [snip]
There is a problem with the common Unix 32-bit time_t implementation,
which runs out in 2106 (if you make it unsigned) or 2038 (if it's
signed). However, nothing in ANSI C says time_t has to be 32 bits.

Nothing says it has to be an integral type. I've seen
implementations where it is a double, and implementations
where it is a struct.

A struct would be non-conforming. The standard requires time_t and
clock_t to be "arithmetic types capable of representing times".
There's no indication of how times are represented; there needn't even
be a direct or linear relationship between the values of type time_t
and the passage of time.
 
J

John Smith

Richard said:
Tell someone on the street that "#" means "a preprocessor directive will
follow", and they're likely to say "a pre-WHAT? Di-WHAT?", and in the
rare case that they're both USAnian and intelligent enough to know the
word "directive", they might well say "Directive? Say, you're not one of
them unamerican pink-livered commie traitors, are you?"

This sort of bigotry is not helpful. You're only displaying your own
ignorance. And, BTW, the proper term is "Pinko."

-JS
 
R

Richard Bos

Joe Wright said:
Gordon Burditt wrote:

And nothing to say it must be integral seconds. Why not double? With
53-bit precision and 2 ^ +-1024 range, we should have interesting times
pretty well covered, from millions of years to small fractions of
nanoseconds.

And if you find a continuity error in Star Trek, you can blame it on
floating point rounding.
And I'm the first to think about and suggest double for time_t, right?

Wrong.

Richard
 
G

glen herrmannsfeldt

Walter said:
If you are going to talk about "classical" interpretations
and "familiar symbols", then Oberon does *not* "get it right".
The "classical" meaning of / (solidus), dating back hundreds of
years, is as a seperator between shilling and pence in writing currency.
The use of solidus as meaning division only goes back a little over
a hundred years according to OED. The use of the solidus as
integer division in C (1972) is directly taken from the same use
in Kerninghan's B (1970) -- predating the decimalization of
UK coinage in 1971.

Integer division with an integer quotient likely came from
Fortran before B and C.

-- glen
 
A

Alan Balmer

Dozens of references claim that the symbol dates back to ancient Rome,
somewhat before shillings and pence, I think.

OTOH, every one of the dozens of references I found is a copy of the
exact same article (long live plagiarism!) and I wonder if the
unacknowledged original author was confusing it with the coin of the
same name.
 

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

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top