+ 3

Differences Between float And double?

What are differences between float and double?

21st Mar 2018, 5:05 PM
NavMen
9 ответов
+ 2
if you wants to declare a small decimal value than use float data type and Double for bigger decimal value.
21st Mar 2018, 5:20 PM
Mohammad Ismail
Mohammad Ismail - avatar
+ 9
Precision is the main difference where float is a single precision (32 bit) floating point data type, double is a double precision (64 bit) floating point data type and decimal is a 128-bit floating point data type. float is represented in 32 bits, with 1 sign bit, 8 bits of exponent, and 23 bits of the significand (or what follows from a scientific-notation number: 2.33728*1012; 33728 is the significand). double is represented in 64 bits, with 1 sign bit, 11 bits of exponent, and 52 bits of significand.
21st Mar 2018, 5:15 PM
Scooby
Scooby - avatar
22nd Mar 2018, 6:40 AM
LukArToDo
LukArToDo - avatar
+ 7
The precision of the floating point representation increases as the magnitude decreases, hence floating point numbers between -1 and 1 are those with the most precision. ... A double is 64 and single precision (float) is 32 bits. The double has a bigger mantissa (the integer bits of the real number).
21st Mar 2018, 5:23 PM
Baraa AB
Baraa AB - avatar
+ 2
My friend your question is good and based on general concepts Differences between float and double is that Double gives us more range of input numbers than float
3rd Apr 2018, 12:02 PM
Sahil Verma [Inactive]
Sahil Verma [Inactive] - avatar
0
so double wont work on 32 bit computers? :P
21st Mar 2018, 5:30 PM
NavMen
0
It's not like that's, when you declared a variable as a Double it's take 64 bit space and 32 bit for float variable
21st Mar 2018, 5:34 PM
Mohammad Ismail
Mohammad Ismail - avatar
0
oh i see, thanks
21st Mar 2018, 5:38 PM
NavMen