2 * Copyright (C) 2014, United States Government, as represented by the
3 * Administrator of the National Aeronautics and Space Administration.
6 * The Java Pathfinder core (jpf-core) platform is licensed under the
7 * Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0.
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 package gov.nasa.jpf.vm;
20 import gov.nasa.jpf.annotation.MJI;
21 import gov.nasa.jpf.vm.MJIEnv;
22 import gov.nasa.jpf.vm.NativePeer;
25 * MJI NativePeer class for java.lang.Float library abstraction
27 public class JPF_java_lang_Float extends NativePeer {
29 public int floatToIntBits__F__I (MJIEnv env, int rcls, float v0) {
30 return Float.floatToIntBits(v0);
34 public int floatToRawIntBits__F__I (MJIEnv env, int rcls, float v0) {
35 return Float.floatToRawIntBits(v0);
39 public float intBitsToFloat__I__F (MJIEnv env, int rcls, int v0) {
40 return Float.intBitsToFloat(v0);
43 // we need to intercept this because it compares double values, which might
44 // cause an ArithmeticException to be raised if -check-fp-compare is set (default)
45 // but -check-fp isn't, and Double.isInfinit is used to handle the cases
46 // explicitly in the program (which is supposed to be the right way)
48 public boolean isInfinite__F__Z (MJIEnv env, int rcls, float v) {
49 return Float.isInfinite(v);
52 // ditto (see isInfinite)
54 public boolean isNaN__F__Z (MJIEnv env, int rcls, float v) {
55 return Float.isNaN(v);