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
// Safe casts are always allowed and allow same kind casts (i.e., downcasts) only when the target array data type is floating-point...
108
108
if(!isMostlySafeCast(vdt,tdt)){
109
-
thrownewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',vdt,tdt));
109
+
thrownewTypeError(format('1rXEw',vdt,tdt));
110
110
}
111
111
// When performing a real-to-complex assignment, interpret the real-valued array as containing real components with implied imaginary components equal to zero and explicitly convert to a complex-valued array...
@@ -75,7 +75,7 @@ function validateBoolean( value, dtype ) {
75
75
if(isBoolean(value)){
76
76
returnnull;
77
77
}
78
-
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',typeofvalue,dtype));
@@ -101,9 +101,9 @@ function validateRealFloating( value, dtype ) {
101
101
returnnull;
102
102
}
103
103
if(isComplexLike(value)){
104
-
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',complexDataType(value),dtype));
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',typeofvalue,dtype));
@@ -128,7 +128,7 @@ function validateComplexFloating( value, dtype ) {
128
128
if(isNumber(value)||isComplexLike(value)){
129
129
returnnull;
130
130
}
131
-
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',typeofvalue,dtype));
@@ -151,18 +151,18 @@ function validateSignedInteger( value, dtype ) {
151
151
varvdt;
152
152
if(isNumber(value)){
153
153
if(!isInteger(value)){
154
-
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',minDataType(value),dtype));
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',vdt,dtype));
160
+
returnnewTypeError(format('1rXEw',vdt,dtype));
161
161
}
162
162
if(isComplexLike(value)){
163
-
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',complexDataType(value),dtype));
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',typeofvalue,dtype));
@@ -188,12 +188,12 @@ function validateUnsignedInteger( value, dtype ) {
188
188
if(isSafeCast(vdt,dtype)){
189
189
returnnull;
190
190
}
191
-
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',vdt,dtype));
191
+
returnnewTypeError(format('1rXEw',vdt,dtype));
192
192
}
193
193
if(isComplexLike(value)){
194
-
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',complexDataType(value),dtype));
returnnewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',typeofvalue,dtype));