Return NaN instead of 0.0 on out-of-bounds read in CArray.
Explicitly cast assigned values to the correct type in P6{int,num}.

Also factors out a shared subexpression in P6num.