answersLogoWhite

0

Double is more precise than float. The 4 bytes saved on a float are usually not very relevant. However, if you need to save large amounts of numbers (e.g. in an array), and you don't need the extra precision, you might save some memory by using float.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

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.


What are two Java primitive types store floating-point numbers?

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


Why java is not a pure object oriented?

java is not purely oops because of primitive types in java like int and float double


How do you change a float into a double using java?

with help of type casting it is possible


Is float is a keyword in java?

yes, float is keyword and data type in java


Can a double value be assigned to float variable?

THIS IS FOR JAVA i don't know about anything about other languages yes it can be assignedthe syntax is:int (number) = (float) numberFOR EXAMPLE:int = a;a = (float ) 5.5;if the (float) is not there then in Java it gives an error saying precision loss of data type


What does the float do in java like declare blablabla as float?

float and double are types of numbers that accept decimals. Consider them as numbers in scientific notation. double allows a larger range of numbers than float, and more significant digits. Usually you would use double, unless you have some special situation, like a large array of numbers, and you decide the extra precision is not necessary.


What are the only types in Java that are not classes?

The non-class Java data types are primitives: * byte * short * int * long * float * double * boolean * char


Eight basic data types used in java?

char, boolean, byte, short, int, long, double, or float


How to declare a float variable in java?

it is the same as an int, String, or any of the others:float myVar = 5.7f;If you try to assign a decimal number you must place an "f" at the end, otherwise Java will assume you are trying to assign a double.


Why the actual arguments declared as float is accepted only as double in formal arguments in java?

Sorry I don't Think I could Solve It


Which numeric type field will you choose to store fractional values?

Floating point types are used to represent fractional numbers. In both C and Java the names for these types are float and double. double offers greater precision than float.