answersLogoWhite

0

Can you compare float with double values?

Updated: 8/18/2019
User Avatar

Wiki User

13y ago

Best Answer

Why have you not try? Of course you can.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you compare float with double values?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why structures does not take float values?

Float-type structure members take float values.


What is the valid floating in c plus plus?

From the C++ standard: "There are three floating point types: float, double, and long double. The type double provides at least as much precision as float, and the type long double provides at least as much precision as double. The set of values of the type float is a subset of the set of values of the type double; the set of values of the type double is a subset of the set of values of the type long double. The value representation of floating-point types is implementation-defined." C++ does not impose any limits upon floating point values because, like all fundamental types, floats are imported from the C standard. However, you can determine those limits at compile time by querying the std::numeric_limits class template from the <limits> header.


Can you compare NaN values?

Yes using the equals method. Example: Double a = new Double(Double.NaN); Double b = new Double(Double.NaN); if( a.equals(b) ) System.out.println("True"); else System.out.println("False"); If you execute the above code snippet you will see "True" in the console. If you try the "==" operator to compare the 2 values a and b you will get only false


What is the range of float?

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


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.


What does the value 'float' mean in C plus plus?

The float data type is a fundamental numeric data type that can represent floating point values. Depending on the implementation, it is normally 4 bytes in size, with a precision around 6 decimal digits.A float is a primitive data type in C++, representing a real number. On 32-bit system, a float occupies 4 bytes, representing values in the range 1.2e-38 to 3.4e38. They are often called single in other languages.A double is also a floating point data type, larger than or equal to a float, but shorter or equal to a long double. On a 32-bit system, a double is 8 bytes long, representing values in the range 2.2e-308 to 1.8e308.A long double is the longest floating point type and is equal to or greater than a double. On 32-bit systems, a long double is generally 10 byes long, representing values in the range 3.4e-4932 to 1.1e4932.Note that in Microsoft's implementation of C++, a long double is the same length as a double, but they are still treated as different types.


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.


What is the difference between float and double in c language?

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)


What do you mean by vectors only hold objects not primitive data types?

It means that you can only store values like Integer, String etc in a Vector and not values like int, float etc. int, float, double etc are primitive data types. collections by their default behavior can hold only objects and not primitives.


What Bytes occupied by double data type in c?

The number of bytes occupied by a specific data type depends on the implementation. In general, the double data type is eight bytes long, but you can check it using sizeof(double). In 16-bit,32-bit compilers double size is 8 bytes.It looks like float because it stores scientific and financial like big float values.


List the eight basic data types used in java and give examples?

The 8 primitive data types are byte, short, int, long, float, double, boolean and char boolean is used to store logical values true/false char is used to store single digit characters. 'Y', 'X' etc the remaining data types are used to store a wide variety of numbers.


Does float data type accept negative values?

Of course, you should have tested: float x= -1.0;