summaryrefslogtreecommitdiff
path: root/libjava/classpath/java/lang/Double.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/lang/Double.java')
-rw-r--r--libjava/classpath/java/lang/Double.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/libjava/classpath/java/lang/Double.java b/libjava/classpath/java/lang/Double.java
index 4fa47f46ddd..26b398bb695 100644
--- a/libjava/classpath/java/lang/Double.java
+++ b/libjava/classpath/java/lang/Double.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package java.lang;
-import gnu.classpath.Configuration;
/**
* Instances of class <code>Double</code> represent primitive
@@ -89,6 +88,12 @@ public final class Double extends Number implements Comparable
public static final double NaN = 0.0 / 0.0;
/**
+ * The number of bits needed to represent a <code>double</code>.
+ * @since 1.5
+ */
+ public static final int SIZE = 64;
+
+ /**
* The primitive type <code>double</code> is represented by this
* <code>Class</code> object.
* @since 1.1
@@ -168,6 +173,22 @@ public final class Double extends Number implements Comparable
}
/**
+ * Returns a <code>Double</code> object wrapping the value.
+ * In contrast to the <code>Double</code> constructor, this method
+ * may cache some values. It is used by boxing conversion.
+ *
+ * @param val the value to wrap
+ * @return the <code>Double</code>
+ *
+ * @since 1.5
+ */
+ public static Double valueOf(double val)
+ {
+ // We don't actually cache, but we could.
+ return new Double(val);
+ }
+
+ /**
* Create a new <code>Double</code> object using the <code>String</code>.
*
* @param s the <code>String</code> to convert