FLOAT vs DOUBLE | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 6

FLOAT vs DOUBLE

Cual es la diferencia entre estos tipos de variables

26th Aug 2017, 9:23 PM
José Noel Rosales Pérez
José Noel Rosales Pérez - avatar
5 Réponses
+ 4
Their only difference is their storage capacity. As I don't remember what their actual capacity is I'll give an example with an analogy. Floats can hold up to say 5 digits like 0.54321 Doubles up to say 20 digits like 0.1234567890987654321 Aside this they also have a marginal impact on performance. Using a data type that accurately describes the data you are using saves a little time in your program. That applies for all data types not just doubles and floats.
26th Aug 2017, 9:55 PM
Haris
Haris - avatar
+ 3
la diferencias son - El formato de cada uno dado por la ieee - La mantisa ya que la del float es variable y la del double no - El cero absoluto no existe en float - Existe mayor precisi√≥n en double - El n√ļmero de bits 32 para float y 64 para doble
1st Sep 2017, 1:27 AM
José Noel Rosales Pérez
José Noel Rosales Pérez - avatar
+ 3
The differences are - The format of each given by the ieee - The mantisa since the float is variable and the double is not - Absolute zero does not exist in float - There may be precision in double - The number of 32 bits for float and 64 for double
1st Sep 2017, 1:28 AM
José Noel Rosales Pérez
José Noel Rosales Pérez - avatar
- 1
a double is bigger than a float. most likely the 2 types you will be using are doubles and ints so u don't need to worry bout it
26th Aug 2017, 9:43 PM
MR.FAKER
MR.FAKER - avatar