it seems a bug in floating point numbers in-place concatenation as illustrated 
below
 a=. i.4 4
   a=. a,("1) 1 2 3
   a
 0  1  2  3 1 2 3
 4  5  6  7 1 2 3
 8  9 10 11 1 2 3
12 13 14 15 1 2 3
 
NB. so far correct, but for floating point numbers
  
   a=. (1.1-1.1)+ i.4 4
   a
 0  1  2  3
 4  5  6  7
 8  9 10 11
12 13 14 15
   a=. a,("1) 1 2 3
   a
 0  1  2  3 1 2 3 0 0 0 0 0 0
 4  5  6  7 1 2 3 0 0 0 0 0 0
 8  9 10 11 1 2 3 1 2 3 1 2 3
12 13 14 15 1 2 3 1 2 3 1 2 3

NB. rubbish columns appended
  
   a=. (1.1-1.1)+ i.4 4
   a=. a,("1) 1 2 3
   a
 0  1  2  3 1 2 3 4.58553e_72 1.5549e_259 0 0 0 0
 4  5  6  7 1 2 3           0           0 0 0 0 0
 8  9 10 11 1 2 3           1           2 3 1 2 3
12 13 14 15 1 2 3           1           2 3 1 2 3

NB. rubbish columns with strange numbers

   a=. (1.1-1.1)+ i.4 4
   ]a=. a,("1) 1 2 3
 0  1  2  3 1 2 3
 4  5  6  7 1 2 3
 8  9 10 11 1 2 3
12 13 14 15 1 2 3
   a
 0  1  2  3 1 2 3
 4  5  6  7 1 2 3
 8  9 10 11 1 2 3
12 13 14 15 1 2 3

NB. strange, if the value is used for further evaluation, the result seems 
correct.

It runs fine if not in-place , eg
 b=. a,("1) 1 2 3

Tested on j6, j7 , 32-bit windows, linux and iphone. not all combinations.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to