Skip to content

Commit 1ea85a9

Browse files
committed
fix
1 parent 38af93a commit 1ea85a9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ToolGood.TdxFormula/TdxMath.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public static TdxNumber SIGN(TdxNumber X)
265265
/// <returns></returns>
266266
public static TdxNumber MOD(TdxNumber X, TdxNumber N)
267267
{
268-
var array = new double[X.Length];
268+
var array = new double[X.Length];
269269
for (int i = 0; i < X.Length; i++) {
270270
array[i] = Math.Round(X[i], 0, MidpointRounding.AwayFromZero) % (int)N[i];
271271
}
@@ -974,6 +974,11 @@ public static TdxNumber BARSSINCEN(TdxNumber X, int N)
974974
}
975975
}
976976
}
977+
for (int i = 0; i < array.Length; i++) {
978+
if (array[i] == -1) {
979+
array[i] = double.NaN;
980+
}
981+
}
977982
return new TdxNumber(array);
978983
}
979984
/// <summary>
@@ -1000,7 +1005,7 @@ public static TdxNumber BARSSINCEN(bool[] X, int N)
10001005
}
10011006
}
10021007
for (int i = 0; i < array.Length; i++) {
1003-
if (array[i]==-1) {
1008+
if (array[i] == -1) {
10041009
array[i] = double.NaN;
10051010
}
10061011
}

ToolGood.TdxFormula/ToolGood.TdxFormula.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1919
<Product>ToolGood.TdxFormula</Product>
2020
<SignAssembly>True</SignAssembly>
21-
<Version>1.0.1.0</Version>
21+
<Version>1.0.1.1</Version>
2222
<DelaySign>false</DelaySign>
2323
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\ToolGood.TdxFormula.xml</DocumentationFile>
2424
<Nullable>disable</Nullable>

0 commit comments

Comments
 (0)