What is the difference between a float & double value

Recommended Answers

All 4 Replies

There are basically the same except for their accuracy.

A float is for example the following :

float F = 3.1415f;

And a double is the following :

double D = 3.1415;

As you can see they are similar, the only difference comes when
accuracy is in play. A double can handle a lot more accurate digits
than a float can.

Usually, a float is good enough to use, than of a type double.
If you don't care about accuracy that much, for example, if
PI = 3.1415972f, is enough accuracy then a double would not be needed. A double will consume more memory than a float will.

What is the difference between a float & double value

If this is a homework question, have you tried looking in your text? Otherwise, how about here?

Way to make 3 threads about one thing at the same time.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.