KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gov > nasa > jpf > jvm > JPF_java_lang_Math


1 //
2
// Copyright (C) 2005 United States Government as represented by the
3
// Administrator of the National Aeronautics and Space Administration
4
// (NASA). All Rights Reserved.
5
//
6
// This software is distributed under the NASA Open Source Agreement
7
// (NOSA), version 1.3. The NOSA has been approved by the Open Source
8
// Initiative. See the file NOSA-1.3-JPF at the top of the distribution
9
// directory tree for the complete NOSA document.
10
//
11
// THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY
12
// KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
13
// LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO
14
// SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
15
// A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT
16
// THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT
17
// DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE.
18
//
19
package gov.nasa.jpf.jvm;
20
21 /**
22  * MJI NativePeer class for java.lang.Math library abstraction
23  */

24 public class JPF_java_lang_Math {
25   public static double abs__D (MJIEnv env, int clsObjRef, double a) {
26     return Math.abs(a);
27   }
28
29   public static float abs__F (MJIEnv env, int clsObjRef, float a) {
30     return Math.abs(a);
31   }
32
33   public static int abs__I (MJIEnv env, int clsObjRef, int a) {
34     return Math.abs(a);
35   }
36
37   public static long abs__J (MJIEnv env, int clsObjRef, long a) {
38     return Math.abs(a);
39   }
40
41   public static double max__DD (MJIEnv env, int clsObjRef, double a, double b) {
42     return Math.max(a, b);
43   }
44
45   public static float max__FF (MJIEnv env, int clsObjRef, float a, float b) {
46     return Math.max(a, b);
47   }
48
49   public static int max__II (MJIEnv env, int clsObjRef, int a, int b) {
50     return Math.max(a, b);
51   }
52
53   public static long max__JJ (MJIEnv env, int clsObjRef, long a, long b) {
54     return Math.max(a, b);
55   }
56
57   public static double min__DD (MJIEnv env, int clsObjRef, double a, double b) {
58     return Math.min(a, b);
59   }
60
61   public static float min__FF (MJIEnv env, int clsObjRef, float a, float b) {
62     return Math.min(a, b);
63   }
64
65   public static int min__II (MJIEnv env, int clsObjRef, int a, int b) {
66     return Math.min(a, b);
67   }
68
69   public static long min__JJ (MJIEnv env, int clsObjRef, long a, long b) {
70     return Math.min(a, b);
71   }
72
73   public static double pow__DD (MJIEnv env, int clsObjRef, double a, double b) {
74     return Math.pow(a, b);
75   }
76
77   public static double sqrt__D (MJIEnv env, int clsObjRef, double a) {
78     return Math.sqrt(a);
79   }
80   
81   public static double random__ (MJIEnv env, int clsObjRef) {
82     return Math.random();
83   }
84   
85   public static double exp__D (MJIEnv env, int clsObjRef, double a) {
86     return Math.exp(a);
87   }
88   
89   public static double asin__D (MJIEnv env, int clsObjRef, double a) {
90     return Math.asin(a);
91   }
92
93   public static double acos__D (MJIEnv env, int clsObjRef, double a) {
94     return Math.acos(a);
95   }
96   
97   public static double atan__D (MJIEnv env, int clsObjRef, double a) {
98     return Math.atan(a);
99   }
100   
101   public static double atan2__DD (MJIEnv env, int clsObjRef, double a, double b) {
102     return Math.atan2(a,b);
103   }
104   
105   public static double ceil__D (MJIEnv env, int clsObjRef, double a) {
106     return Math.ceil(a);
107   }
108   
109   public static double cos__D (MJIEnv env, int clsObjRef, double a) {
110     return Math.cos(a);
111   }
112   
113   public static double floor__D (MJIEnv env, int clsObjRef, double a) {
114     return Math.floor(a);
115   }
116   
117   public static double log__D (MJIEnv env, int clsObjRef, double a) {
118     return Math.log(a);
119   }
120   
121   public static double rint__D (MJIEnv env, int clsObjRef, double a) {
122     return Math.rint(a);
123   }
124   
125   public static double sin__D (MJIEnv env, int clsObjRef, double a) {
126     return Math.sin(a);
127   }
128   
129   public static double tan__D (MJIEnv env, int clsObjRef, double a) {
130     return Math.tan(a);
131   }
132 }
Popular Tags