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 |
402 * hexadecimal value; this exact numerical value is then |
402 * hexadecimal value; this exact numerical value is then |
403 * conceptually converted to an "infinitely precise" |
403 * conceptually converted to an "infinitely precise" |
404 * binary value that is then rounded to type {@code double} |
404 * binary value that is then rounded to type {@code double} |
405 * by the usual round-to-nearest rule of IEEE 754 floating-point |
405 * by the usual round-to-nearest rule of IEEE 754 floating-point |
406 * arithmetic, which includes preserving the sign of a zero |
406 * arithmetic, which includes preserving the sign of a zero |
407 * value. Finally, a {@code Double} object representing this |
407 * value. |
408 * {@code double} value is returned. |
408 * |
|
409 * Note that the round-to-nearest rule also implies overflow and |
|
410 * underflow behaviour; if the exact value of {@code s} is large |
|
411 * enough in magnitude (greater than or equal to ({@link |
|
412 * #MAX_VALUE} + {@link Math#ulp(double) ulp(MAX_VALUE)}/2), |
|
413 * rounding to {@code double} will result in an infinity and if the |
|
414 * exact value of {@code s} is small enough in magnitude (less |
|
415 * than or equal to {@link #MIN_VALUE}/2), rounding to float will |
|
416 * result in a zero. |
|
417 * |
|
418 * Finally, after rounding a {@code Double} object representing |
|
419 * this {@code double} value is returned. |
409 * |
420 * |
410 * <p> To interpret localized string representations of a |
421 * <p> To interpret localized string representations of a |
411 * floating-point value, use subclasses of {@link |
422 * floating-point value, use subclasses of {@link |
412 * java.text.NumberFormat}. |
423 * java.text.NumberFormat}. |
413 * |
424 * |