Skip to content

Commit 735aff4

Browse files
committed
Version 1.7.1
1 parent 1f2e081 commit 735aff4

File tree

5 files changed

+35
-19
lines changed

5 files changed

+35
-19
lines changed

Numbers.nuspec

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<package
2-
><metadata><version>1.7.0</version><id>PeterO.Numbers</id><requireLicenseAcceptance>false</requireLicenseAcceptance><releaseNotes>Version 1.7.0
2+
><metadata><version>1.7.1</version><id>PeterO.Numbers</id><requireLicenseAcceptance>false</requireLicenseAcceptance><releaseNotes>Version 1.7.1
3+
4+
- Fix bugs in new char[] and byte[] overloads of FromString
5+
6+
Version 1.7.0
37

48
- Added overloads to string-to-number methods that take char[] and byte[] arrays.
59
- Added methods that convert EDecimal, EFloat, and ERational to and from raw bits that follow IEEE 754 binary floating-point formats (To/FromDoubleBits, To/FromSingleBits).
610
- Added Log1P and ExpM1 methods to EDecimal and EFloat
711
- Added &apos;long&apos; overloads to several arithmetic methods
812
- Added implication and equivalence (Imp/Eqv) methods and an nth-root method to EInteger</releaseNotes><summary></summary><license type='expression'>CC0-1.0</license><projectUrl>https://github.com/peteroupc/Numbers</projectUrl><authors>Peter Occil</authors><description>A C# library that supports arbitrary-precision binary and decimal floating-point numbers and rational numbers with arbitrary-precision components, and supports arithmetic with these numbers.</description><owners>Peter Occil</owners><title>Arbitrary-Precision Number Library</title><tags>numbers arithmetic decimal math</tags><dependencies><group targetFramework='.NETStandard1.0' /><group targetFramework='.NETFramework2.0' /><group targetFramework='.NETFramework4.0' /></dependencies></metadata><files><file src='Numbers/bin/Release/netstandard1.0/Numbers.dll' target='/lib/netstandard1.0' /><file src='Numbers/bin/Release/netstandard1.0/Numbers.xml' target='/lib/netstandard1.0' /><file src='Numbers20/bin/Release/Numbers.dll' target='/lib/net20' /><file src='Numbers20/bin/Release/Numbers.xml' target='/lib/net20' /><file src='Numbers40/bin/Release/Numbers.dll' target='/lib/net40' /><file src='Numbers40/bin/Release/Numbers.xml' target='/lib/net40' /></files></package
9-
>
13+
>

Numbers20/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Reflection;
22
[assembly: System.CLSCompliant(true)]
3-
[assembly: AssemblyInformationalVersion("1.7.0")]
4-
[assembly: AssemblyVersion("1.7.0.0")]
5-
[assembly: AssemblyFileVersion("1.7.0.0")]
3+
[assembly: AssemblyInformationalVersion("1.7.1")]
4+
[assembly: AssemblyVersion("1.7.1.0")]
5+
[assembly: AssemblyFileVersion("1.7.1.0")]
66
[assembly: AssemblyProduct("Arbitrary-Precision Number Library")]
77
[assembly: AssemblyTitle("Arbitrary-Precision Number Library")]
88
[assembly: AssemblyDescription("A C# library that supports arbitrary-pre" +

Numbers40/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Reflection;
22
[assembly: System.CLSCompliant(true)]
3-
[assembly: AssemblyInformationalVersion("1.7.0")]
4-
[assembly: AssemblyVersion("1.7.0.0")]
5-
[assembly: AssemblyFileVersion("1.7.0.0")]
3+
[assembly: AssemblyInformationalVersion("1.7.1")]
4+
[assembly: AssemblyVersion("1.7.1.0")]
5+
[assembly: AssemblyFileVersion("1.7.1.0")]
66
[assembly: AssemblyProduct("Arbitrary-Precision Number Library")]
77
[assembly: AssemblyTitle("Arbitrary-Precision Number Library")]
88
[assembly: AssemblyDescription("A C# library that supports arbitrary-pre" +

Test/DecTestUtil.cs

+18-6
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,16 @@ public static void AssertFlagsRestricted(
333333
"DivideByZero: " + str);
334334
}
335335

336-
private static bool Contains(string str, string sub) {
337-
return (sub.Length == 1) ?
338-
(str.IndexOf(sub[0], StringComparison.Ordinal) >= 0) :
339-
(str.IndexOf(sub, StringComparison.Ordinal) >= 0);
336+
public static bool Contains(string str, string sub) {
337+
if (sub.Length == 1) {
338+
for (var i = 0; i < str.Length; ++i) {
339+
if (str[i] == sub[0]) {
340+
return true;
341+
}
342+
}
343+
return false;
344+
}
345+
return str.IndexOf(sub, StringComparison.Ordinal) >= 0;
340346
}
341347

342348
private static bool StartsWith(string str, string sub) {
@@ -969,10 +975,16 @@ public bool IsZeroValue() {
969975

970976
internal static int ParseLineInput(string ln) {
971977
if (ln.Length == 0) {
972-
{ return 0;
978+
return 0;
979+
}
980+
int ix = -1;
981+
for (var i = 0; i < ln.Length; ++i) {
982+
if (ln[i] == '\u0020') {
983+
// Space found
984+
ix = i;
985+
break;
973986
}
974987
}
975-
int ix = ln.IndexOf(' ', StringComparison.Ordinal);
976988
// NOTE: ix < 2 includes cases where space is not found
977989
if (ix < 2 || (ln[ix - 1] != 'd' && ln[ix - 1] != 's' &&
978990
ln[ix - 1] != 'q')) {

Test/ExtensiveTest.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public void TestParser() {
5050
++x;
5151
var context = new Dictionary<string, string>();
5252
var lowerF = DecTestUtil.ToLowerCaseAscii(f);
53-
var isinput = lowerF.Contains(".input");
54-
if (!lowerF.Contains(".input") &&
55-
!lowerF.Contains(".txt") &&
56-
!lowerF.Contains(".dectest") &&
57-
!lowerF.Contains(".fptest")) {
53+
var isinput = DecTestUtil.Contains(lowerF, ".input");
54+
if (!DecTestUtil.Contains(lowerF, ".input") &&
55+
!DecTestUtil.Contains(lowerF, ".txt") &&
56+
!DecTestUtil.Contains(lowerF, ".dectest") &&
57+
!DecTestUtil.Contains(lowerF, ".fptest")) {
5858
continue;
5959
}
6060
using (var w = new StreamReader(f)) {

0 commit comments

Comments
 (0)