Community
Participate
Working Groups
Build Identifier: 20110916-0149 To avoid leaking implementation details of IReal, the place to perform mathematical operations on IReals is inside the concrete implementations. For initial implementation we selected log, ln, exp, pow, nroot, sqrt, sin, cos, and tan as operations to support. We cannot use standard java Math methods since they use floating point math. Therefore, we have to implement the calculations for BigDecimal ourself (existing libraries have incompatible licenses). The implementations are based on the book "Java Number Cruncher: The Java Programmer's Guide to Numerical Computing" for which the author has shared the code as public domain (http://authors.phptr.com/mak/downloads.html) (the ln, nroot, sqr, and exp are from this source). Lastly the PI and E constants are added to the IValueFactory since they are often needed in relation to the mathematical operations selected. Attached to this enhancement request is the patch implementing the above changes. (All the functions were validated against their java Math version). Reproducible: Always
Created attachment 207719 [details] patch implementing the proposed changes
Created attachment 207811 [details] generated pi and e myself and added precision parameters to the IValueFactory e and pi methods As requested I've now manually generated the PI and E constants (IP problems). Their precision is 1000 decimals. Also I added a precision parameter to both e and pi because else the 1000 decimal precision will affect all the other calculations once either pi() or e() is used.
For IP reasons: > a. I authored 100% of the content (excluding content originating from > Ronald Mak via Java Number Cruncher: The Java Programmer's Guide to Numerical > Computing) yes > b. I have the right to contribute the content to Eclipse yes > c. I contribute the content under the EPL yes