Search code examples
nanj

Why in J 0%0 is defined, but _%_ gives a NaN error?


I J, 0%0 (zero divided by zero) gives 0 as an answer. However, _%_ (infinity divided by infinity) gives a NaN error? Why isn't it defined, while 0%0 is?


Solution

  • I think the comment from Eelvex gives the answer. infinity over infinity is indeterminate. The indeterminate symbol in J is _.. However, this exists only to take care of data coming from external source, and J sentences shouldn't gives _. as an answer.

    If 0 over 0 is defined as 0, this is because it has some practical uses. There are no such practical uses for infinity over infinity.