Skip to content

Commit

Permalink
Almost ready to release version 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
peteroupc committed Apr 29, 2021
1 parent e597ab1 commit d9c14c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
23 changes: 5 additions & 18 deletions Numbers/Numbers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,12 @@
<PackageLicenseExpression>CC0-1.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/peteroupc/Numbers</PackageProjectUrl>
<PackageReleaseNotes>
Version 1.7.3
Version 1.8

- Fix bugs and regressions involving EInteger's Pow, Root, and new Gcd

Version 1.7.2

- Improve performance of EInteger's Gcd method for large integers

Version 1.7.1

- Fix bugs in new char[] and byte[] overloads of FromString

Version 1.7.0

- Added overloads to string-to-number methods that take char[] and byte[] arrays.
- 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).
- Added Log1P and ExpM1 methods to EDecimal and EFloat
- Added 'long' overloads to several arithmetic methods
- Added implication and equivalence (Imp/Eqv) methods and an nth-root method to EInteger
- Add LowBits family of methods to EInteger
- Add FromInt64AsUnsigned to EInteger, EDecimal, EFloat, and ERational
- Add overload to FromBytes method of EInteger
- Bug fixes

</PackageReleaseNotes>
<PackageTags>numbers arithmetic decimal math</PackageTags>
Expand Down
13 changes: 11 additions & 2 deletions Numbers/PeterO/Numbers/RadixMath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ public T Ln(T thisValue, EContext ctx) {
EInteger cprec = EInteger.Max(bounds[1].ToEInteger(), ctx.Precision)
.Add(bigError);
// DebugUtility.Log("cprec prec " + (// ctx.Precision) + " bounds " +
// (bounds[1].ToEInteger()));
//(bounds[1].ToEInteger()));
ctxdiv = SetPrecisionIfLimited(ctx, cprec)
.WithRounding(intermedRounding).WithBlankFlags();
T oldThisValue = thisValue;
Expand Down Expand Up @@ -2297,7 +2297,16 @@ public T Power(T thisValue, T pow, EContext ctx) {
return this.SignalInvalid(ctx);
}
signedMant = this.helper.GetMantissa(powInt).Abs();
return this.PowerIntegral(thisValue, signedMant, ctx);
// Use this line rather than commented line because in this case, where
// thisValue is 1 and power is a negative integer, the reciprocal of 1
// is used, which will have an exponent of 0, according to the
// General Decimal Arithmetic Specification
if (powSign < 0) {
return this.PowerIntegral(this.helper.ValueOf(1), signedMant,
ctx);
} else {
return this.PowerIntegral(thisValue, signedMant, ctx);
}
}
}
// Very high values of pow and a very high exponent
Expand Down

0 comments on commit d9c14c9

Please sign in to comment.