+ 2

What is the difference between float And double?

18th May 2022, 5:18 PM
Gayatri Dunakhe
Gayatri Dunakhe - avatar
4 Antworten
+ 3
A float takes up only 32 bits of memory and can give you 7 decimal digits whilst a double takes up 64 bits of memory and can give you 15 decimal digits and therefore is more precise but hogs more memory.
18th May 2022, 5:26 PM
Justice
Justice - avatar
+ 1
Accuracy, but this requires more computing resources and memory.
18th May 2022, 5:22 PM
JaScript
JaScript - avatar
+ 1
additionally to what Justice said: on a regular x86_64 machine a float would be 4 Bytes and a double 8bytes assuming u know that this is equivalent to 32Bit and 64 bit respectively.
18th May 2022, 5:48 PM
Tizian Gottschlich
Tizian Gottschlich - avatar