2 @METHODDEFAULT("OUT<IN")
4 @LOC("T") static final double PI=3.14159265358979323846;
6 // an alias for setPI()
7 public static double PI() {
8 double PI = 3.14159265358979323846;
12 public static int abs(int x) {
16 public static long abs(long x) {
20 public static double abs(double x) {
24 public static float abs(float x) {
28 public static double max(double a, double b) {
32 public static float max(float a, float b) {
36 public static int max(int a, int b) {
40 public static long max(long a, long b) {
45 public static double min(@LOC("IN") double a, @LOC("IN") double b) {
50 public static float min(@LOC("IN") float a, @LOC("IN") float b) {
55 public static int min(@LOC("IN") int a, @LOC("IN") int b) {
60 public static long min(@LOC("IN") long a, @LOC("IN") long b) {
64 /** sqrt(a^2 + b^2) without under/overflow. **/
65 public static double hypot(double a, double b) {
67 if (abs(a) > abs(b)) {
69 r = abs(a)*sqrt(1+r*r);
72 r = abs(b)*sqrt(1+r*r);
79 public static double rint(double x) {
83 if( ((int)y)%2 == 0 ) {
88 } else if( d < 0.5 ) {
94 public static native double sin(double a);
95 public static native double cos(double a);
96 public static native double asin(double a);
97 public static native double acos(double a);
98 public static native double tan(double a);
99 public static native double atan(double a);
100 public static native double atan2(double a, double b);
101 public static native double exp(double a);
102 public static native double sqrt(double a);
103 public static native double log(double a);
104 public static native double pow(double a, double b);
106 public static native double ceil(double a);
107 public static native double floor(double a);
109 public static native float sinf(float a);
110 public static native float cosf(float a);
111 public static native float expf(float a);
112 public static native float sqrtf(float a);
113 public static native float logf(float a);
114 public static native float powf(float a, float b);
115 public static native float ceilf(float a);
116 public static native float IEEEremainder(float f1, float f2);