File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
ch.obermuhlner.math.big.example/src/main/java/ch/obermuhlner/math/big/example Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ package ch .obermuhlner .math .big .example ;
2
+
3
+ import ch .obermuhlner .math .big .BigDecimalMath ;
4
+
5
+ import java .math .BigDecimal ;
6
+ import java .math .MathContext ;
7
+
8
+ /**
9
+ * Example class for a fictive project that needs a specific precision in its calculations.
10
+ */
11
+ public class HighPrecisionMath {
12
+ public static MathContext MATH_CONTEXT = new MathContext (100 );
13
+
14
+ public static BigDecimal PI = BigDecimalMath .pi (MATH_CONTEXT );
15
+
16
+ public static BigDecimal pow (BigDecimal x , BigDecimal y ) {
17
+ return BigDecimalMath .pow (x , y , MATH_CONTEXT );
18
+ }
19
+
20
+ public static BigDecimal sin (BigDecimal x ) {
21
+ return BigDecimalMath .sin (x , MATH_CONTEXT );
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments