239 * are zero, in which case a single zero is used. Next, the
240 * exponent is represented by {@code "p"} followed
241 * by a decimal string of the unbiased exponent as if produced by
242 * a call to {@link Integer#toString(int) Integer.toString} on the
243 * exponent value.
244 *
245 * <li>If <i>m</i> is a {@code double} value with a subnormal
246 * representation, the significand is represented by the
247 * characters {@code "0x0."} followed by a
248 * hexadecimal representation of the rest of the significand as a
249 * fraction. Trailing zeros in the hexadecimal representation are
250 * removed. Next, the exponent is represented by
251 * {@code "p-1022"}. Note that there must be at
252 * least one nonzero digit in a subnormal significand.
253 *
254 * </ul>
255 *
256 * </ul>
257 *
258 * <table border>
259 * <caption><h3>Examples</h3></caption>
260 * <tr><th>Floating-point Value</th><th>Hexadecimal String</th>
261 * <tr><td>{@code 1.0}</td> <td>{@code 0x1.0p0}</td>
262 * <tr><td>{@code -1.0}</td> <td>{@code -0x1.0p0}</td>
263 * <tr><td>{@code 2.0}</td> <td>{@code 0x1.0p1}</td>
264 * <tr><td>{@code 3.0}</td> <td>{@code 0x1.8p1}</td>
265 * <tr><td>{@code 0.5}</td> <td>{@code 0x1.0p-1}</td>
266 * <tr><td>{@code 0.25}</td> <td>{@code 0x1.0p-2}</td>
267 * <tr><td>{@code Double.MAX_VALUE}</td>
268 * <td>{@code 0x1.fffffffffffffp1023}</td>
269 * <tr><td>{@code Minimum Normal Value}</td>
270 * <td>{@code 0x1.0p-1022}</td>
271 * <tr><td>{@code Maximum Subnormal Value}</td>
272 * <td>{@code 0x0.fffffffffffffp-1022}</td>
273 * <tr><td>{@code Double.MIN_VALUE}</td>
274 * <td>{@code 0x0.0000000000001p-1022}</td>
275 * </table>
276 * @param d the {@code double} to be converted.
277 * @return a hex string representation of the argument.
278 * @since 1.5
279 * @author Joseph D. Darcy
|
239 * are zero, in which case a single zero is used. Next, the
240 * exponent is represented by {@code "p"} followed
241 * by a decimal string of the unbiased exponent as if produced by
242 * a call to {@link Integer#toString(int) Integer.toString} on the
243 * exponent value.
244 *
245 * <li>If <i>m</i> is a {@code double} value with a subnormal
246 * representation, the significand is represented by the
247 * characters {@code "0x0."} followed by a
248 * hexadecimal representation of the rest of the significand as a
249 * fraction. Trailing zeros in the hexadecimal representation are
250 * removed. Next, the exponent is represented by
251 * {@code "p-1022"}. Note that there must be at
252 * least one nonzero digit in a subnormal significand.
253 *
254 * </ul>
255 *
256 * </ul>
257 *
258 * <table border>
259 * <caption>Examples</caption>
260 * <tr><th>Floating-point Value</th><th>Hexadecimal String</th>
261 * <tr><td>{@code 1.0}</td> <td>{@code 0x1.0p0}</td>
262 * <tr><td>{@code -1.0}</td> <td>{@code -0x1.0p0}</td>
263 * <tr><td>{@code 2.0}</td> <td>{@code 0x1.0p1}</td>
264 * <tr><td>{@code 3.0}</td> <td>{@code 0x1.8p1}</td>
265 * <tr><td>{@code 0.5}</td> <td>{@code 0x1.0p-1}</td>
266 * <tr><td>{@code 0.25}</td> <td>{@code 0x1.0p-2}</td>
267 * <tr><td>{@code Double.MAX_VALUE}</td>
268 * <td>{@code 0x1.fffffffffffffp1023}</td>
269 * <tr><td>{@code Minimum Normal Value}</td>
270 * <td>{@code 0x1.0p-1022}</td>
271 * <tr><td>{@code Maximum Subnormal Value}</td>
272 * <td>{@code 0x0.fffffffffffffp-1022}</td>
273 * <tr><td>{@code Double.MIN_VALUE}</td>
274 * <td>{@code 0x0.0000000000001p-1022}</td>
275 * </table>
276 * @param d the {@code double} to be converted.
277 * @return a hex string representation of the argument.
278 * @since 1.5
279 * @author Joseph D. Darcy
|