answersLogoWhite

0

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

14y ago

What else can I help you with?

Related Questions

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.


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 market and floating market?

a floating market floats but an market dont float


What is the difference between a cat and a balloon?

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


How can I convert a float to a double in Java?

To convert a float to a double in Java, you can simply assign the float value to a double variable. Java will automatically perform the conversion for you. Here's an example: java float floatValue 10.5f; double doubleValue floatValue; In this example, the float value 10.5f is assigned to the double variable doubleValue, which will now hold the converted double value.


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


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.


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 are two Java primitive types store floating-point numbers?

In Java, you can use either a float or a double