Subject: RE: [hackers-il] 2 tiny C riddles

From: Chen Shapira <[email-masked]>
Date: Wed, 22 Nov 2000 15:35:18 +0200

> Am I missing something here? This doesn't seem like a riddle, 
> but rather
> requires knowing the exact details of the P6 floating point 
> and integer
> architecture... Or is the point you're trying to make that 
> the answer for
> the "float" question different in nature from the "int" one 
> (I won't say any
> more to not ruin it for others)?

It might be my fault. When I was told the riddle, I kept argueing that the
answer is implementation specific and that no standard can tell what to do
with overflowing float.
I think the intel P6 part is excessive and unnecessary for solution.

---

From: "Nadav Har'El" <[email-masked]>
Date: Wed, 22 Nov 2000 15:54:23 +0200

Small spoiler ahead, be careful...

> I think the intel P6 part is excessive and unnecessary for solution.

Actually, the float example will *not* overflow, for any "typical" floating
point implementation! (If I say any more I'm afraid I'll ruin the question -
maybe the whole point of the question was to notice that fact).
But still, I maintain that the maximal value is very much dependant on the
implementation (choice of number of bits for matissa, etc.).

-- 
Nadav Har'El                        |  Wednesday, Nov 22 2000, 24 Heshvan 5761
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |If at first you don't succeed, skydiving
http://nadav.harel.org.il           |is not for you.

---

From: Omer Mussaev <[email-masked]>
Date: Wed, 22 Nov 2000 17:27:54 +0200

> implementation (choice of number of bits for matissa, etc.).

I included P6 part just to make sure that: we are not talking about typical
implementation of int and float in typical
computer. I was afraid to be misunderstood and misinterpreted into some wierd numerical
library fucntions or virtual
machine. Otherwise P6 part is irrelevant.