1 |
/* Float.java -- object wrapper for float |
/* Float.java -- object wrapper for float |
2 |
Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 |
3 |
|
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
6 |
|
|
39 |
|
|
40 |
package java.lang; |
package java.lang; |
41 |
|
|
|
import gnu.classpath.Configuration; |
|
|
|
|
42 |
/** |
/** |
43 |
* Instances of class <code>Float</code> represent primitive |
* Instances of class <code>Float</code> represent primitive |
44 |
* <code>float</code> values. |
* <code>float</code> values. |
101 |
private final float value; |
private final float value; |
102 |
|
|
103 |
/** |
/** |
|
* Load native routines necessary for this class. |
|
|
*/ |
|
|
static |
|
|
{ |
|
|
if (Configuration.INIT_LOAD_LIBRARY) |
|
|
{ |
|
|
System.loadLibrary("javalang"); |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
104 |
* Create a <code>Float</code> from the primitive <code>float</code> |
* Create a <code>Float</code> from the primitive <code>float</code> |
105 |
* specified. |
* specified. |
106 |
* |
* |
426 |
* @return the bits of the <code>float</code> |
* @return the bits of the <code>float</code> |
427 |
* @see #intBitsToFloat(int) |
* @see #intBitsToFloat(int) |
428 |
*/ |
*/ |
429 |
public static native int floatToIntBits(float value); |
public static int floatToIntBits(float value) |
430 |
|
{ |
431 |
|
return VMFloat.floatToIntBits(value); |
432 |
|
} |
433 |
|
|
434 |
/** |
/** |
435 |
* Convert the float to the IEEE 754 floating-point "single format" bit |
* Convert the float to the IEEE 754 floating-point "single format" bit |
444 |
* @return the bits of the <code>float</code> |
* @return the bits of the <code>float</code> |
445 |
* @see #intBitsToFloat(int) |
* @see #intBitsToFloat(int) |
446 |
*/ |
*/ |
447 |
public static native int floatToRawIntBits(float value); |
public static int floatToRawIntBits(float value) |
448 |
|
{ |
449 |
|
return VMFloat.floatToRawIntBits(value); |
450 |
|
} |
451 |
|
|
452 |
/** |
/** |
453 |
* Convert the argument in IEEE 754 floating-point "single format" bit |
* Convert the argument in IEEE 754 floating-point "single format" bit |
462 |
* @see #floatToIntBits(float) |
* @see #floatToIntBits(float) |
463 |
* @see #floatToRawIntBits(float) |
* @see #floatToRawIntBits(float) |
464 |
*/ |
*/ |
465 |
public static native float intBitsToFloat(int bits); |
public static float intBitsToFloat(int bits) |
466 |
|
{ |
467 |
|
return VMFloat.intBitsToFloat(bits); |
468 |
|
} |
469 |
|
|
470 |
/** |
/** |
471 |
* Compare two Floats numerically by comparing their <code>float</code> |
* Compare two Floats numerically by comparing their <code>float</code> |