I agree with your conjecture about the likely cause. I wonder, though, about mapped files. If the indexing primitives polish their arguments, will a mapped argument be altered on disk? That I would find worrying. And if a mapped operand is readonly, either (a) it would be modified or (b) i. would work slower or would fail if it contains negative zero.
I'm just wondering. None of this matters a bit to me. Henry Rich > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Mark > D. Niemiec > Sent: Saturday, June 02, 2007 1:42 AM > To: [email protected] > Subject: Re: [Jprogramming] A negative-zero challenge > > "Henry Rich" <[EMAIL PROTECTED]> wrote: > > > Here's a session log: > > > > nz =. 0 % _1 NB. negative zero > > 3!:3 nz > > e1000000 > > 08000000 > > 01000000 > > 00000000 > > 00000000 > > 00000080 > > ''&mysteryprimitive nz > > 0 > > 3!:3 nz > > e1000000 > > 08000000 > > 01000000 > > 00000000 > > 00000000 > > 00000000 > > > > > > Look! the dyad mysteryprimitive cleaned up the negative zero > > to make it a nice shiny positive zero. No assignments are > performed. > > > > What is the mysteryprimitive? (There are several possible answers). > > mysteryprimitive =: -. > mysteryprimitive =: e. > mysteryprimitive =: i. > mysteryprimitive =: i: > > > Why does it polish zeros? > > I would guess it's part of the voodoo Roger uses to > reduce all of these from quadratic to linear time. > > I would conjecture that the fact that 0=!.0 [0%_1 > even though they have distinct binary representations > might throw a wrinkle into such code, so 'cleaning up' > the parameters (especially when doing so has no > 'discernable effect' (other than perhaps 3!:3 here)) > would be considered an acceptible relaxation of the > 'functions must not alter their arguments' rule. > > -- Mark D. Niemiec <[EMAIL PROTECTED]> > > ---------------------------------------------------------------------- > For information about J forums see > http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
