Double Variable:
Double precision, as denoted by the double keyword user 64 bit to store a value. Double precision is actually faster then single
precision some modern processors that have been optimized for high-speed mathematical calculation . All trancedental math functions , such as sine(), cos(),return double value, When you need to maintain accuracy over many iterative calculations, or
are manipulating large-valued numbers double is the best choice.
here short program double variable to compute the area of circle.
class Area
{
public static void main(String[]args)
{
double pi,r,a;
r=10.8;// radius of circle
pi=3.1416;// pi,approximately
a=pi*r*r;// compute area
System.out.println("Area of circle"+a);
}
}
0 comments:
Post a Comment