src/share/classes/java/lang/Float.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 554,602 ****
public String toString() {
return Float.toString(value);
}
/**
! * Returns the value of this {@code Float} as a {@code byte} (by
! * casting to a {@code byte}).
*
* @return the {@code float} value represented by this object
* converted to type {@code byte}
*/
public byte byteValue() {
return (byte)value;
}
/**
! * Returns the value of this {@code Float} as a {@code short} (by
! * casting to a {@code short}).
*
* @return the {@code float} value represented by this object
* converted to type {@code short}
* @since JDK1.1
*/
public short shortValue() {
return (short)value;
}
/**
! * Returns the value of this {@code Float} as an {@code int} (by
! * casting to type {@code int}).
*
* @return the {@code float} value represented by this object
* converted to type {@code int}
*/
public int intValue() {
return (int)value;
}
/**
! * Returns value of this {@code Float} as a {@code long} (by
! * casting to type {@code long}).
*
* @return the {@code float} value represented by this object
* converted to type {@code long}
*/
public long longValue() {
return (long)value;
}
--- 554,606 ----
public String toString() {
return Float.toString(value);
}
/**
! * Returns the value of this {@code Float} as a {@code byte} after
! * a narrowing primitive conversion.
*
* @return the {@code float} value represented by this object
* converted to type {@code byte}
+ * @jls 5.1.3 Narrowing Primitive Conversions
*/
public byte byteValue() {
return (byte)value;
}
/**
! * Returns the value of this {@code Float} as a {@code short}
! * after a narrowing primitive conversion.
*
* @return the {@code float} value represented by this object
* converted to type {@code short}
+ * @jls 5.1.3 Narrowing Primitive Conversions
* @since JDK1.1
*/
public short shortValue() {
return (short)value;
}
/**
! * Returns the value of this {@code Float} as an {@code int} after
! * a narrowing primitive conversion.
*
* @return the {@code float} value represented by this object
* converted to type {@code int}
+ * @jls 5.1.3 Narrowing Primitive Conversions
*/
public int intValue() {
return (int)value;
}
/**
! * Returns value of this {@code Float} as a {@code long} after a
! * narrowing primitive conversion.
*
* @return the {@code float} value represented by this object
* converted to type {@code long}
+ * @jls 5.1.3 Narrowing Primitive Conversions
*/
public long longValue() {
return (long)value;
}
*** 608,622 ****
public float floatValue() {
return value;
}
/**
! * Returns the {@code double} value of this {@code Float} object.
*
* @return the {@code float} value represented by this
! * object is converted to type {@code double} and the
! * result of the conversion is returned.
*/
public double doubleValue() {
return (double)value;
}
--- 612,627 ----
public float floatValue() {
return value;
}
/**
! * Returns the value of this {@code Float} as a {@code double}
! * after a widening primitive conversion.
*
* @return the {@code float} value represented by this
! * object converted to type {@code double}
! * @jls 5.1.2 Widening Primitive Conversions
*/
public double doubleValue() {
return (double)value;
}