int j = 0;
for(double d:vals)if(d != 0)nonzeros[nzs++] = j++;
Key key = Vec.newKey();
AppendableVec av = new AppendableVec(key);
NewChunk nv = new NewChunk(av,0);
<BUG>for(double d:vals)nv.addNum(d);
nv.close(0,null);</BUG>
Vec vec = av.close(new Futures());
return vec.chunkForChunkIdx(0);
}

int j = 0;
for(double d:vals)if(d != 0)nonzeros[nzs++] = j++;
Key key = Vec.newKey();
AppendableVec av = new AppendableVec(key);
NewChunk nv = new NewChunk(av,0);
for(double d:vals){
if(Double.isNaN(d))nv.addNA();
else if((long)d == d) nv.addNum((long)d,0);
else nv.addNum(d);
}
nv.close(0,null);
Vec vec = av.close(new Futures());
return vec.chunkForChunkIdx(0);
}
