Commit 87510bb
authored
Fix
This PR proposes to fix issue #2878 where
`dpnp.tensor.expm1(complex(-0.0, 0.0))` returned `-0.0 + 0.0j` on CPU
instead of `0.0 + 0.0j` as required by the Array API specification
The fix adds an explicit special-case branch for `complex(±0, 0)` in
`expm1.hpp` so CPU and GPU behavior are now consistent and compliant
with the specification.
Also `test_expm1_special_cases` test was extended to cover
`complex(-0.0, 0.0)`dpnp.tensor.expm1 handling of complex(+-0, 0) (#2926)1 parent def2ea1 commit 87510bb
3 files changed
Lines changed: 14 additions & 1 deletion
File tree
- dpnp
- tensor/libtensor/include/kernels/elementwise_functions
- tests/tensor/elementwise
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| |||
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
187 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
0 commit comments