You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Case: array syntax (e.g., [ Slice(0,10,1), null, Slice(4,null,-1) ]) or Slice or integer or arbitrary string (where the latter three are not valid for >2d arrays)
87
87
else{
88
88
s=sargs2multislice(prop);
89
-
if(s===null){
89
+
if(s===null){// FIXME: need to gracefully handle non-existent properties
// If the input value is real-valued number, we need to inspect the value to determine whether we can safely cast the value to the target array data type...
90
+
// If the input value is a real-valued number, we need to inspect the value to determine whether we can safely cast the value to the target array data type...
93
91
elseif(isNumber(value)){
94
-
// If the target array has a floating-point data type, we can just go ahead and cast the input scalar to the target array data type...
92
+
// If the target array has a floating-point data type, we can just go ahead and cast the input scalar to the target array data type, as number literals are, by default, double-precision floating-point values and casting to lower-precision floating-point is allowed...
95
93
if(isFloatingDataType(dt)){
96
94
value=scalar2ndarray(value,options(dt));
97
95
}
98
96
// If the target array has an unsigned integer data type, then the assigned value must be a compatible nonnegative integer value...
99
97
elseif(isUnsignedIntegerDataType(dt)){
100
-
vdt=minDataType(value);
98
+
vdt=minDataType(value);// note: we rely on data type resolution to handle the case where `value` is a non-integer value. In that case, `vdt` will resolve to a floating-point data type and `isSafeCast` will evaluate to `false`
0 commit comments