answersLogoWhite

0


Best Answer

float is a primitive datatype in java that is used to hold numeric values that contain decimal places.

Ex: float f = 10;

The above is an example declaration of a float variable. They can be used in all arithmetic operations like addition, subtraction, multiplication, division etc.

It uses 32 bits and there is as such no minimum or maximum value it can take. The value that a float can hold is larger than all possible numeric values that we can use in our systems (in most cases)

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Precision, mainly. Example:

{

float f= sqrt(2);

double d= sqrt(2);

printf ("f*f-2=%g\n", f*f-2);

printf ("d*d-2=%g\n", d*d-2);

}

f*f-2=-6.84571e-08

d*d-2=2.73436e-16

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

A float is used to represent a single-precision floating point value. A double is used to represent a double-precision floating point value. Generally, a float is 32-bits in length while a double is 64-bits in length, however the actual lengths are implementation-defined.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Yes, double is a data type, it means double precision floating point number.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Float and double is used in fractions. Float gives upto 6 decimal points and double gives upto 14 decimal points.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

float data type take the data into float values for ex:0.23f and 0.23665

and integer data type take the data into integers for example: 123654,0xA

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between float and double in c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between displacer float?

and what. air bubble system? or Hydrometer??


What is the range of float?

i wann't ask the range of double float and long double float??


What is the difference between double and float?

A float is usually 32 bits, which means it's got a precision of 2^16 - 1 before the comma, and 2^16 - 1 after the comma. A double's usually 64 bits, so it's got a precision of 2^32 - 1 on both sides of the comma.


Give atleast 5 data type in turbo c language?

char, short, long, float, double.


What is the difference between float and buoyancy?

My friend knows but sadly i dont I will tell you later


Difference between single precision and double precision?

Single Precision, called "float" in the 'C' language family, and "real" or "real*4" in Fortan. This is a binary format that occupies 32 bits (4 bytes) and its significand has a precision of 24 bits (about 7 decimal digits). Double Precision called "double" in the C language family, and "double precision" or "real*8" in Fortran. This is a binary format that occupies 64 bits (8 bytes) and its significand has a precision of 53 bits (about 16 decimal digits). Regards, Prabhat Mishra


What is the difference between a cat and a balloon?

(0.0 XD) I mean Balloons float and cats purr.!


What is the difference between market and floating market?

a floating market floats but an market dont float


How many bytes are in a decimal variable?

It depends on the language. In C/C++, decimal values are specified using float, double or long double types. A float is a single precision floating point value that is typically 32-bits in length, however the actual length is implementation dependant. A double is always at least as long as a float while a long double is always at least as long as a double. To determine the actual length at compile time, we use the sizeof() operator.


Why should double data type is preferable over float data type?

by default any float value is double


If you have a variable like float monthlypayment error message says found double requires float in monthlyPayment mortgageFunds interestRate?

Just use a double instead of a float. Double allows for a larger number and you won't produce that error.


What is the difference between integer numbers and float numbers?

Integer numbers : ...-5,-4,-3,-2,-1,0,1,2,3,4,5... Float numbers 1.25, 1.26 etc They are float numbers because its value can be altered after the point, which is based on an integer number.