20.10
java.lang.Double
THE PACKAGE JAVA.LANG
How many digits must be printed for the fractional part of
m
or
a
? There must
be at least one digit to represent the fractional part, and beyond that as many, but
only as many, more digits as are needed to uniquely distinguish the argument
value from adjacent values of type
double
. That is, suppose that
x
is the exact
mathematical value represented by the decimal representation produced by this
method for a finite nonzero argument
d
. Then
d
must be the
double
value nearest
to
x
; or if two
double
values are equally close to
x
, then
d
must be one of them
and the least significant bit of the significand of
d
must be
0
.
[This specification for the method
toString
is scheduled for introduction in
Java version 1.1. In previous versions of Java, this method produces
Inf
instead of
Infinity
for infinite values. Also, it rendered finite values in the same form as
the
%g
format of the
printf
function in the C programming language, which can
lose information because it produces at most six digits after the decimal point.]
20.10.16
public static Double valueOf(String s)
throws NullPointerException, NumberFormatException
The string
s
is interpreted as the representation of a floating point value and a
Double
object representing that value is created and returned.
If
s
is
null
, then a
NullPointerException
is thrown.
Leading and trailing whitespace ( 20.5.19) characters in
s
are ignored. The
rest of
s
should constitute a
FloatValue
as described by the lexical syntax rule:
FloatValue:
Sign
opt
Digits
.
Digits
opt
ExponentPart
opt
Sign
opt
.
Digits ExponentPart
opt
where
Sign
,
Digits
, and
ExponentPart
are as defined in 3.10.2. If it does not have
the form of a
FloatValue
, then a
NumberFormatException
is thrown. Otherwise,
it is regarded as representing an exact decimal value in the usual computerized
scientific notation ; this exact decimal value is then conceptually converted to an
infinitely precise binary value that is then rounded to type
double
by the usual
round to nearest rule of IEEE 754 floating point arithmetic. Finally, a new object
of class
Double
is created to represent the
double
value.
Note that neither
D
nor
d
is permitted to appear in
s
as a type indicator, as
would be permitted in Java source code ( 3.10.1).
20.10.17
public boolean isNaN()
The result is
true
if and only if the value represented by this
Double
object is
NaN.
514
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved