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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
<sectionclass="release"id="unreleased">
6
6
7
-
## Unreleased (2024-06-20)
7
+
## Unreleased (2024-06-21)
8
8
9
9
<sectionclass="features">
10
10
@@ -18,12 +18,23 @@
18
18
19
19
<!-- /.features -->
20
20
21
+
<sectionclass="bug-fixes">
22
+
23
+
### Bug Fixes
24
+
25
+
-[`d301be9`](https://github.com/stdlib-js/stdlib/commit/d301be9e2cabe07efe219c00d10aebd15e0673e7) - ensure support for real-to-complex casting in boolean and mask array indexing
26
+
27
+
</section>
28
+
29
+
<!-- /.bug-fixes -->
30
+
21
31
<sectionclass="commits">
22
32
23
33
### Commits
24
34
25
35
<details>
26
36
37
+
-[`d301be9`](https://github.com/stdlib-js/stdlib/commit/d301be9e2cabe07efe219c00d10aebd15e0673e7) - **fix:** ensure support for real-to-complex casting in boolean and mask array indexing _(by Athan Reines)_
-[`550285b`](https://github.com/stdlib-js/stdlib/commit/550285bf4a57dd3dabc8ed3998e7b612515fe082) - **feat:** add support for boolean and mask array assignment _(by Athan Reines)_
// Safe casts are always allowed and allow same kind casts (i.e., downcasts) only when the target array data type is floating-point...
95
108
if(!isMostlySafeCast(vdt,tdt)){
96
109
thrownewTypeError(format('invalid operation. Assigned value cannot be safely cast to the target array data type. Data types: [%s, %s].',vdt,tdt));
97
110
}
98
-
if(idx.type==='bool'){
99
-
try{
100
-
place(target,idx.data,v,'strict_broadcast');
101
-
}catch(err){
102
-
thrownewerr.constructor(errMessage(err.message));
103
-
}
104
-
returntrue;
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...
112
+
if(isComplexDataType(tdt)&&isRealDataType(vdt)){
113
+
v=convert(v,tdt);
105
114
}
106
115
if(idx.type==='mask'){
116
+
// NOTE: we intentionally deviate from boolean array indexing here and interpret the mask as applying to both the target and values array, thus requiring that the assigned value array be broadcast compatible with the target array and NOT just the selected elements as in boolean array indexing
107
117
try{
108
-
where(idx.data,target,v,target,1,0);// note: intentionally deviate from boolean array indexing here and interpret the mask as applying to both the target and values array, thus requiring that the assigned value array be broadcast compatible with the target array and NOT just the selected elements as in boolean array indexing
0 commit comments