JDK-8324271 : java.lang.Math for BigDecimal and BigInteger
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.math
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2024-01-21
  • Updated: 2024-01-22
  • Resolved: 2024-01-22
Related Reports
Relates :  
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
BigDecimal and BigInteger come with basic functionalities like adding, dividing - similar to the operations +, / in the java language for double or int.
But both lack additional functionalities that are available for double in java.lang.Math like sin() or have restrictions on those functionalities e.g. BigDecimal.pow() only works with integers while Math.pow() works with doubles.

Please provide additional functionality in BigDecimal and BigInteger or (better) provide a java.lang.Math helper-class for BigDecimal and BigInteger with all functionalities of java.lang.Math.

Cornell University has some (no longer maintaines) OS-implementations for those - see https://arxiv.org/src/0908.3030v3/anc



Comments
The lack of demand for and community interest in transcendental functions on decimal numbers combined with BigDecimal and BigInteger not having in general use cases for scientific calculations suggests that there is not a great intrinsic need to provide such functions. Furthermore, the scientific background appears to be lacking and many special cases would need to be handled in rounding. Resolving as "will not fix."
22-01-2024

See previous bugs JDK-4297957 and JDK-8190946.
22-01-2024

Moved to JDK for more evaluations.
22-01-2024