See http://www.jsoftware.com/jwiki/Essays/Tolerant_Comparison#Comparisons_with_0
On Sat, Nov 29, 2014 at 10:22 PM, robert therriault <[email protected]> wrote: > It looks to me as if the fact that 0 is being compared is significant. > > 0 (~:!.0) 1e_45 > 1 > 0 (~:) 1e_45 > 1 > > I would expect the intolerant ~:!.0 to return 1, but the tolerant ~: to > return 0, except that I think that 0 may be multiplied by the default > tolerance to produce the intolerant fit of 0 > > You could also do a definition using match (-:) instead of not equal (~:) > > matchnotreal =. -.@-: + > #I.0=(iscomplex=matchnotreal)1 j. -:^:a:1 > 1 > > J can be so surprising. > > Cheers, bob > > On Nov 29, 2014, at 10:09 PM, Henry Rich <[email protected]> wrote: > > > Yes, I believe it would. > > > > Whether that's desirable is a different question. > > > > Henry Rich > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
