It occured to me that I should test the various vector lengths. Having done it, it appears the problem is always associated with the first calculation in the vector being a problem value.
Bugs =: 3 : 0 r =. i. 0 i =. 0 while. i <: y do. a =. 0.1 * i: i try. b =. 1 o. a catch. r =. r , i end. i =. i + 1 end. r ) a=.Bugs 10000 $a 4973 10 10$a 8 9 14 15 16 18 22 25 27 28 30 31 32 33 35 36 37 39 40 42 45 48 49 53 56 59 60 61 62 64 65 66 67 70 73 77 78 81 84 86 87 89 90 91 96 98 99 101 103 104 105 112 113 115 117 118 120 122 123 124 128 129 130 131 132 134 135 137 140 141 142 144 148 151 153 154 156 157 161 162 163 165 168 173 175 176 179 182 185 187 192 193 196 199 200 203 205 207 210 212 Paul On Mar 22, 2012 3:45 PM, "Paul Jackson" <plj...@gmail.com> wrote: > I've found a strange set of errors doing trig on fractions. These do not > occur on my 32 or 64 bit PCs. They also don't occur if x is integers. > > x=.0.1*i:58 > y=.1 o. x > > x=.0.1*i:59. NB. this is the first vector length where I saw the error > y=.1 o. x > |NaN error > | y=.1 o.x > > x=.0.1*i:143 NB. this is where it seems to disappear > y=.1 o. x > > I wrote a loop to find problems one scalar at a time. There doesn't > seem to be any upper limit to the failures this way. > > Bug =: 3 : 0 > r =. i. 0 > i =. - y > > while. i <: y do. > a =. 0.1 * i > > try. > b =. 1 o. a > catch. > r =. r , a > end. > > i =. i + 1 > end. > r > ) > > Bug 60 > > _6 _5.9 _5.6 _5.3 _4.9 _4.8 _4.5 _4.2 _4 > _3.9 _3.7 _3.6 _3.5 _3.3 _3.2 _3.1 _3 _2.8 > _2.7 _2.5 _2.2 _1.8 _1.6 _1.5 _1.4 _0.9 _0.8 > 0.8 0.9 1.4 1.5 1.6 1.8 2.2 2.5 2.7 > 2.8 3 3.1 3.2 3.3 3.5 3.6 3.7 3.9 > 4 4.2 4.5 4.8 4.9 5.3 5.6 5.9 6 > > Paul > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm