The result used to be -. but that change was documented:

http://www.jsoftware.com/release/inf0.htm

Even 0*-. produces 0,

   0*_.
0


On Mon, Mar 5, 2018 at 12:06 PM, Henry Rich <[email protected]> wrote:

> Once you accept that 0%0 is 0, a lot of NaNs go away.
>
> Henry Rich
>
> On 3/5/2018 10:17 AM, Raul Miller wrote:
>
>> For completeness, here's the fixed floydrecon:
>>
>> floydrecon=: verb define
>>    n=. ($y)$_(I._=,y)},($$i.@#)y
>>    for_j. i.#y do.
>>      d=. y <. j ({"1 +/ {) y
>>      b=. y~:d
>>      y=. d
>>      n=. (n*-.b)+b * j{"1 n
>>    end.
>> )
>>
>> The problem with the earlier version was that 0 * _ is 0 and not
>> infinity. (Though, now that I think about this, I'm wondering about
>> why this doesn't throw a NaN error ... perhaps because the problem
>> occurs so often that NaN errors would be needlessly disruptive?)
>>
>> This version deals with that by avoiding the use of arithmetic on
>> infinities when computing n.
>>
>>
>
> ---
> This email has been checked for viruses by AVG.
> http://www.avg.com
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to