Wednesday, May 30, 2018

Floating-Point Types using JAVA

Floating-Point Types using JAVA
Floating-point numbers, also known as real numbers, are used when evaluating
expressions that require fractional precision. For example, calculations such as square
root, or transcendentals such as sine and cosine, result in a value whose precision
requires a floating-point type. Java implements the standard (IEEE–754) set of floating-point types and operators. There are two kinds of floating-point types, float
and double, which represent single- and double-precision numbers, respectively. Their
width and ranges are shown here:
Name Width in Bits Approximate Range
double 64 4.9e–324 to 1.8e+308
float 32 1.4e−045 to 3.4e+038
Each of these floating-point types is examined next.
banner
Previous Post
Next Post

0 comments: