@@ -2125,7 +2125,15 @@ struct Slice(SliceKind kind, size_t[] packs, Iterator)
21252125 else
21262126 {
21272127 static if (ls.N == 1 )
2128- mixin (" ls.front " ~ op ~ " = value.front;" );
2128+ {
2129+ static if (op == " ^^" && isFloatingPoint! (typeof (ls.front)) && isFloatingPoint! (typeof (value.front)))
2130+ {
2131+ import mir.math.common: pow;
2132+ ls.front = pow(ls.front, value.front);
2133+ }
2134+ else
2135+ mixin (" ls.front " ~ op ~ " = value.front;" );
2136+ }
21292137 else
21302138 static if (rpacks == [1 ])
21312139 ls.front.opIndexOpAssignImplValue! op(value.front);
@@ -2217,7 +2225,15 @@ struct Slice(SliceKind kind, size_t[] packs, Iterator)
22172225 do
22182226 {
22192227 static if (ls.N == 1 )
2220- mixin (" ls.front " ~ op ~ " = value[0];" );
2228+ {
2229+ static if (op == " ^^" && isFloatingPoint! (typeof (ls.front)) && isFloatingPoint! (typeof (value[0 ])))
2230+ {
2231+ import mir.math.common: pow;
2232+ ls.front = pow(ls.front, value[0 ]);
2233+ }
2234+ else
2235+ mixin (" ls.front " ~ op ~ " = value[0];" );
2236+ }
22212237 else
22222238 mixin (" ls.front[] " ~ op ~ " = value[0];" );
22232239 value = value[1 .. $];
@@ -2449,7 +2465,14 @@ struct Slice(SliceKind kind, size_t[] packs, Iterator)
24492465 {
24502466 return mixin (` t` ~ op ~ ` = v` );
24512467 }
2452- return mixin (` _iterator[indexStride(_indexes)] ` ~ op ~ ` = value` );
2468+ auto str = indexStride(_indexes);
2469+ static if (op == " ^^" && isFloatingPoint! DeepElemType && isFloatingPoint! (typeof (value)))
2470+ {
2471+ import mir.math.common: pow;
2472+ _iterator[str] = pow(_iterator[str], value);
2473+ }
2474+ else
2475+ return mixin (` _iterator[str] ` ~ op ~ ` = value` );
24532476 }
24542477
24552478 static if (doUnittest)
0 commit comments