What is the data type for the number 9.6352?

Options
- float
- double
- Float
- Double


CORRECT ANSWER : double

Discussion Board
answer of this question that why will we use "double".not a float type

in this qouestion 9.6352 datatype is double considered because of java is also consider float value as a double type...double use to large range of decimal numbers...but in another case if we write 9.6352f then we always consider float type because of "in case of type casting or type conversion we also use return datatype" int this case we want to change the size of 9.6352(as a float)..so we will write float type...but in before case (9.6352)we dont want to change (type conversion or type casting)..so we will use double type of this value..(in java float variable consider as a double type)..........

somdutt 09-22-2014 02:10 AM

Quote nideesha

Same question.
Why the answer is not float?

Giuseppe 09-13-2014 03:22 AM

Double and Float

There is no much difference in float and double. The differences are as follows:

Float data type is of 32 bit whereas double support 64 bit data stream.
Float data type is used for large values but it is not as precise as double when used with currency values.
For decimal values the double data type is default choice and preferable choice as it supports large range of data values.

Examples are as follows:

The floating point types (float and double) can also be expressed using E or e (for scientific notation), F or f (32-bit float literal) and D or d (64-bit double literal; this is the default and by convention is omitted).

double d1 = 123.4;
// same value as d1, but in scientific notation
double d2 = 1.234e2;
float f1 = 123.4f;

Now you can see that double can work with large decimal values due to its support of large decimal values.


Rohit Sharma 07-28-2014 02:07 AM

fewd

what is the differnt between float and double?why isnot the answer float?

nideesha 07-6-2014 02:53 PM

Write your comments

 
   
 
 

Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement