3 public static double setPI() {
4 double PI = 3.14159265358979323846;
8 // an alias for setPI()
9 public static double PI() {
10 double PI = 3.14159265358979323846;
14 public static int abs(int x) {
22 public static double fabs(double x) {
30 public static double abs(double x) {
38 public static float abs(float a) {
44 public static double max(double a, double b) {
54 public static int max(int a, int b) {
64 public static int imax(int a, int b) {
74 public static int imin(int a, int b) {
84 /** sqrt(a^2 + b^2) without under/overflow. **/
85 public static double hypot(double a, double b) {
87 if (fabs(a) > fabs(b)) {
89 r = fabs(a)*sqrt(1+r*r);
92 r = fabs(b)*sqrt(1+r*r);
99 public static double rint(double x) {
103 if( ((int)y)%2 == 0 ) {
108 } else if( d < 0.5 ) {
114 public static native double sin(double a);
115 public static native double cos(double a);
116 public static native double asin(double a);
117 public static native double acos(double a);
118 public static native double tan(double a);
119 public static native double atan(double a);
120 public static native double atan2(double a, double b);
121 public static native double exp(double a);
122 public static native double sqrt(double a);
123 public static native double log(double a);
124 public static native double pow(double a, double b);
126 public static native double ceil(double a);
127 public static native double floor(double a);
129 public static native float sinf(float a);
130 public static native float cosf(float a);
131 public static native float expf(float a);
132 public static native float sqrtf(float a);
133 public static native float logf(float a);
134 public static native float powf(float a, float b);