2 static final double PI=3.14159265358979323846;
4 // an alias for setPI()
5 public static double PI() {
6 double PI = 3.14159265358979323846;
10 public static int abs(int x) {
14 public static long abs(long x) {
18 public static double abs(double x) {
22 public static float abs(float x) {
26 public static double max(double a, double b) {
30 public static float max(float a, float b) {
34 public static int max(int a, int b) {
38 public static long max(long a, long b) {
42 public static double min(double a, double b) {
46 public static float min(float a, float b) {
49 public static int min(int a, int b) {
52 public static long min(long a, long b) {
56 /** sqrt(a^2 + b^2) without under/overflow. **/
57 public static double hypot(double a, double b) {
59 if (abs(a) > abs(b)) {
61 r = abs(a)*sqrt(1+r*r);
64 r = abs(b)*sqrt(1+r*r);
71 public static double rint(double x) {
75 if( ((int)y)%2 == 0 ) {
80 } else if( d < 0.5 ) {
86 public static native double sin(double a);
87 public static native double cos(double a);
88 public static native double asin(double a);
89 public static native double acos(double a);
90 public static native double tan(double a);
91 public static native double atan(double a);
92 public static native double atan2(double a, double b);
93 public static native double exp(double a);
94 public static native double sqrt(double a);
95 public static native double log(double a);
96 public static native double pow(double a, double b);
98 public static native double ceil(double a);
99 public static native double floor(double a);
101 public static native float sinf(float a);
102 public static native float cosf(float a);
103 public static native float expf(float a);
104 public static native float sqrtf(float a);
105 public static native float logf(float a);
106 public static native float powf(float a, float b);
107 public static native float ceilf(float a);
108 public static native float IEEEremainder(float f1, float f2);