We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6f2c3d commit 0817001Copy full SHA for 0817001
src/NumSharp.Core/Operations/NdArray.Division.cs
@@ -103,6 +103,29 @@ public partial class NDArray
103
104
return sum;
105
}
106
-
+
107
+ public static NDArray operator /(int scalar, NDArray np1)
108
+ {
109
+ return (double)scalar / np1;
110
+ }
111
112
+ public static NDArray operator /(double scalar, NDArray np1)
113
114
+ var nd = new NDArray(typeof(double), np1.shape);
115
116
+ switch (np1.dtype.Name)
117
118
+ case "Double":
119
+ nd.Set(np1.float64.Select(x => scalar / x).ToArray());
120
+ break;
121
+ case "Int32":
122
+ nd.Set(np1.int32.Select(x => scalar / x).ToArray());
123
124
125
126
+ return nd;
127
128
129
130
131
0 commit comments