Commit Graph

31 Commits

Author SHA1 Message Date
Gilles Sadowski 43ebe7bc45 Obsolete package. 2021-12-30 16:12:28 +01:00
Gilles Sadowski 22753536f4 Class "JdkMath" bridges user code and alternative implementations.
It's a "drop-in" replacement for JDK's "Math" as of Java 8 (cf. MATH-1630).

"AccurateMath" contains pure Java, acccurate, implementations of "Math" functions.
But it is no longer required to implement all of them.
2021-10-17 01:46:06 +02:00
Gilles Sadowski 21e230ae83 MATH-1630: Runtime switch between JDK and CM implementations of the methods defined in "java.lang.Math".
Default is to use the CM implementations in order to retain previous behaviour.
When using the JDK implementations, some unit tests fail (on Java 8).

Class "AccurateMath" was moved to "o.a.c.math4.core" package.
[Unit tests for that class were not moved because they depend on "legacy" classes.]
2021-10-16 11:14:09 +02:00
Gilles Sadowski 39c47671f2 MATH-1629: Throw "ArithmeticException" instead of "MathArithmeticException". 2021-10-16 10:41:46 +02:00
Gilles Sadowski cb5f001821 Spurious "throws" clauses. 2021-10-14 11:00:24 +02:00
Gilles Sadowski 6e745db400 Javadoc. 2021-10-14 11:00:24 +02:00
Gilles Sadowski 5460d4d755 Use "valueOf".
Call to constructor is deprecated in Java 11.
2021-10-14 11:00:24 +02:00
Alex Herbert 033c7e2c39 Correct verification of zero length values and weights
This bug was found when checking the sonar report for the variance class
which uses MathArrays.verifyValues.
2021-08-21 14:37:13 +02:00
Alex Herbert e693b4d264 Use JUnit 5 Assertions for exact double equality
Fix checkstyle
2021-08-18 23:33:00 +01:00
Alex Herbert 56b7b12c2a Simplify atan2 expressions when y is non-zero 2021-08-18 23:16:01 +01:00
Alex Herbert 7cb883c54b sonar fix: avoid division by zero in atan2 when y=0 2021-08-18 23:02:55 +01:00
Alex Herbert f06bb2aa3f Update atan2 special cases test
Enumerate all combinations of 0, infinity and another value (0.1) with
+/- for each. Results are the same with java.lang.Math.
2021-08-18 23:02:55 +01:00
Alex Herbert f6fe96b23f Sonar fix: Replace x != x with Double.isNaN 2021-08-18 18:30:53 +01:00
Alex Herbert e97c3288a5 Sonar fix: Cast operands to double before assigning result to double 2021-08-18 16:41:10 +01:00
Gilles Sadowski 8804071ac7 Update copyright information. 2021-08-14 03:24:08 +02:00
Arturo Bernal 1e4662de5a
Simplify assertions with simpler equivalent. (#196) 2021-08-13 09:24:22 +01:00
Gilles Sadowski 26fc13cf66 Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-math 2021-08-07 15:34:48 +02:00
Gilles Sadowski 92a3b0c040 Replace calls to deprecated method. 2021-08-07 15:26:02 +02:00
Arturo Bernal 3aab631272 MATH-1573 - Redundant local variable 2021-08-07 13:37:21 +01:00
Arturo Bernal 1c8d8da63a MATH-1572: Simplify conditional expressions
* Simplify bitwise
* Simplify boolean expression
* Simplify conditional expression
* Redundant 'if' statement
2021-08-07 13:19:32 +01:00
Gilles Sadowski f9c0a8b678 Miscellaneous "sonarcloud" suggestions. 2021-07-18 15:07:01 +02:00
aherbert 6ce950d5a3 MATH-1576: Reinstate checkstyle
Checkstyle has been suppressed for the legacy module.

Fixed the new modules to pass the checkstyle configuration ported from
Commons-Numbers.
2021-06-25 12:08:35 +01:00
Gilles Sadowski 03923d2b79 Adapt to "Commons Numbers" API update (cf. NUMBERS-163). 2021-06-23 02:09:48 +02:00
Gilles Sadowski 0a3c4023dd Functionality has been moved to "Commons Numbers" (cf. NUMBERS-164). 2021-06-17 15:22:48 +02:00
Gilles Sadowski bdc4a527fb Remove dependencies on unused "Commons Numbers" modules. 2021-06-10 18:27:59 +02:00
Gilles Sadowski 1d83419c90 Adapt to "Commons Numbers" API updates.
Cf. NUMBERS-159.
2021-06-09 16:20:39 +02:00
Gilles Sadowski ba2a1c2434 Utility class moved to module "commons-math-legacy-core". 2021-06-01 17:31:40 +02:00
Gilles Sadowski 02d14e6791 Utility class moved to module "commons-math-legacy-core". 2021-06-01 17:17:51 +02:00
Gilles Sadowski 44d1f03669 Delete files that were added to the repository by mistake. 2021-06-01 07:02:05 +02:00
Gilles Sadowski c3ec07380f Additional test passes. 2021-06-01 01:25:15 +02:00
Gilles Sadowski e85e8b53f2 Create module "commons-math-legacy-core" for holding functionality needed by many "legacy" modules.
"FastMath" (renamed "AccurateMath") and related classes moved to "o.a.c.m.legacy.core.jdkmath".
2021-06-01 00:26:35 +02:00