> The same kind of performance hit occurs anywhere else where user code > has to work around unwanted interpreter defaults, like value- > safe arithmetic: > vsp1 =: + :: (_."_)"0 > vsp2 =: +`(_."_)@.(+.&isnan)"0 > vst2 =: *`(_."_)@.(+.&isnan)`0:@.(+.&(0&=))"0 NB. Since 0 > = _.*0 = 0*_. > vsd2 =: %`(_."_)@.(+.&isnan)`0:@.((0=[)+._=|])"0 NB. > Since 0 = _.%_ = 0%_.
As stated before, _. is provided to aid in dealing with NaN in data from external sources, and should be removed from such data as soon as possible. To deliberately put _. into your data is extremely reckless. ----- Original Message ----- From: "Mark D. Niemiec" <[EMAIL PROTECTED]> Date: Sunday, March 16, 2008 18:32 Subject: Re: [Jprogramming] Handling NaN error with #:_ To: [email protected] > Roger Hui <[EMAIL PROTECTED]> wrote: > > > _ 0 0 as the result of 0 100 100#:_ is hard to justify, > > as is x|_ giving 0 for nonzero x . > > J defines _ as an integer (since _ = <._). In fact, it is > defined to > evenly divide all integers, since _%d is _ (and hence an integer) > for all finite integers d. Thus, conceptually, _ = */i._ > So, for consistency, x|_ should always give 0 for any integer x. ... ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
