[#4595] New block syntax — Daniel Amelang <daniel.amelang@...>

I'm really sorry if this isn't the place to talk about this. I've

25 messages 2005/03/21
[#4606] Re: New block syntax — "David A. Black" <dblack@...> 2005/03/21

Hi --

[#4629] Re: New block syntax — "Sean E. Russell" <ser@...> 2005/03/30

On Monday 21 March 2005 16:17, David A. Black wrote:

[#4648] about REXML::Encoding — speakillof <speakillof@...>

Hi.

15 messages 2005/03/31
[#4659] Re: about REXML::Encoding — "Sean E. Russell" <ser@...> 2005/04/04

On Thursday 31 March 2005 09:44, speakillof wrote:

Re: 0**0==1?

From: Johan Holmberg <holmberg@...>
Date: 2005-03-23 15:26:29 UTC
List: ruby-core #4615
On Sat, 19 Mar 2005, Alexandru Popescu wrote:
> [quote Christian Neukirchen::on 3/19/2005 3:00 PM]
>> Bertram Scharpf <lists@bertram-scharpf.de> writes:
>>
>>>
>>> this is difficult to feed Google with:
>>>
>>>>> 0**0
>>> => 1
>>>>> 0**0.0
>>> => 1.0
>>>>> 0.0**0
>>> => 1.0
>>>>> 0.0**0.0
>>> => 1.0
>>>>>
>>>
>>> Shouldn't the result be a NaN?
>>
[...]
>
> Theoretically speaking any number (the rule does not exclude 0) at power 0 is 1.
>

Maybe the C standard can be of some help:

In the C standard, in normative Annex F (IEC 60559 floating-point 
arithmetic), section F.9.4.4 (The pow function) it says:

     pow(x, +/-0) returns 1 for any x, even a NaN.

I guess Ruby uses "pow" for Float#**.

/Johan Holmberg


In This Thread

Prev Next