Skip to content

Commit d9c14c9

Browse files
committed
Almost ready to release version 1.8
1 parent e597ab1 commit d9c14c9

2 files changed

Lines changed: 16 additions & 20 deletions

File tree

Numbers/Numbers.csproj

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,12 @@
1414
<PackageLicenseExpression>CC0-1.0</PackageLicenseExpression>
1515
<PackageProjectUrl>https://github.com/peteroupc/Numbers</PackageProjectUrl>
1616
<PackageReleaseNotes>
17-
Version 1.7.3
17+
Version 1.8
1818

19-
- Fix bugs and regressions involving EInteger's Pow, Root, and new Gcd
20-
21-
Version 1.7.2
22-
23-
- Improve performance of EInteger's Gcd method for large integers
24-
25-
Version 1.7.1
26-
27-
- Fix bugs in new char[] and byte[] overloads of FromString
28-
29-
Version 1.7.0
30-
31-
- Added overloads to string-to-number methods that take char[] and byte[] arrays.
32-
- 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).
33-
- Added Log1P and ExpM1 methods to EDecimal and EFloat
34-
- Added 'long' overloads to several arithmetic methods
35-
- Added implication and equivalence (Imp/Eqv) methods and an nth-root method to EInteger
19+
- Add LowBits family of methods to EInteger
20+
- Add FromInt64AsUnsigned to EInteger, EDecimal, EFloat, and ERational
21+
- Add overload to FromBytes method of EInteger
22+
- Bug fixes
3623

3724
</PackageReleaseNotes>
3825
<PackageTags>numbers arithmetic decimal math</PackageTags>

Numbers/PeterO/Numbers/RadixMath.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ public T Ln(T thisValue, EContext ctx) {
14961496
EInteger cprec = EInteger.Max(bounds[1].ToEInteger(), ctx.Precision)
14971497
.Add(bigError);
14981498
// DebugUtility.Log("cprec prec " + (// ctx.Precision) + " bounds " +
1499-
// (bounds[1].ToEInteger()));
1499+
//(bounds[1].ToEInteger()));
15001500
ctxdiv = SetPrecisionIfLimited(ctx, cprec)
15011501
.WithRounding(intermedRounding).WithBlankFlags();
15021502
T oldThisValue = thisValue;
@@ -2297,7 +2297,16 @@ public T Power(T thisValue, T pow, EContext ctx) {
22972297
return this.SignalInvalid(ctx);
22982298
}
22992299
signedMant = this.helper.GetMantissa(powInt).Abs();
2300-
return this.PowerIntegral(thisValue, signedMant, ctx);
2300+
// Use this line rather than commented line because in this case, where
2301+
// thisValue is 1 and power is a negative integer, the reciprocal of 1
2302+
// is used, which will have an exponent of 0, according to the
2303+
// General Decimal Arithmetic Specification
2304+
if (powSign < 0) {
2305+
return this.PowerIntegral(this.helper.ValueOf(1), signedMant,
2306+
ctx);
2307+
} else {
2308+
return this.PowerIntegral(thisValue, signedMant, ctx);
2309+
}
23012310
}
23022311
}
23032312
// Very high values of pow and a very high exponent

0 commit comments

Comments
 (0)