1 /* |
1 /* |
2 * Copyright 1994-2006 Sun Microsystems, Inc. All Rights Reserved. |
2 * Copyright 1994-2009 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Sun designates this |
7 * published by the Free Software Foundation. Sun designates this |
363 * hexadecimal value; this exact numerical value is then |
363 * hexadecimal value; this exact numerical value is then |
364 * conceptually converted to an "infinitely precise" |
364 * conceptually converted to an "infinitely precise" |
365 * binary value that is then rounded to type {@code float} |
365 * binary value that is then rounded to type {@code float} |
366 * by the usual round-to-nearest rule of IEEE 754 floating-point |
366 * by the usual round-to-nearest rule of IEEE 754 floating-point |
367 * arithmetic, which includes preserving the sign of a zero |
367 * arithmetic, which includes preserving the sign of a zero |
368 * value. Finally, a {@code Float} object representing this |
368 * value. |
369 * {@code float} value is returned. |
369 * |
|
370 * Note that the round-to-nearest rule also implies overflow and |
|
371 * underflow behaviour; if the exact value of {@code s} is large |
|
372 * enough in magnitude (greater than or equal to ({@link |
|
373 * #MAX_VALUE} + {@link Math#ulp(float) ulp(MAX_VALUE)}/2), |
|
374 * rounding to {@code float} will result in an infinity and if the |
|
375 * exact value of {@code s} is small enough in magnitude (less |
|
376 * than or equal to {@link #MIN_VALUE}/2), rounding to float will |
|
377 * result in a zero. |
|
378 * |
|
379 * Finally, after rounding a {@code Float} object representing |
|
380 * this {@code float} value is returned. |
370 * |
381 * |
371 * <p>To interpret localized string representations of a |
382 * <p>To interpret localized string representations of a |
372 * floating-point value, use subclasses of {@link |
383 * floating-point value, use subclasses of {@link |
373 * java.text.NumberFormat}. |
384 * java.text.NumberFormat}. |
374 * |
385 * |