answersLogoWhite

0

Of course, you should have tested:

float x= -1.0;

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

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.


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.


Which is the wrapper class for the data type float?

The wrapper class for float is Float. java.lang.


Why can't have only float data type instead int and float?

Because that is how the language is defined. It has floating data types and integral data types.


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.

Related Questions

What are the potential drawbacks or limitations of using a graph with negative values in data visualization?

Using a graph with negative values in data visualization can make it harder to interpret the data accurately. Negative values may distort the scale of the graph and make it challenging to compare different data points effectively. Additionally, negative values can sometimes be misleading or confusing for viewers, leading to misinterpretation of the data.


When your sample data is all negative values how can you convert it for use on a normal distribution?

The data from a normal distribution are symmetric about its mean, not about zero. There is, therefore nothing strange about all the values being negative.


Can a normal distribution have a negative mean?

Yes. If much of your data has negative values, it's likely that the mean will be negative, too.


What function in c plus plus that only accept numbers?

All data is digital in a digital computer -- the numbers are merely an abstraction for real objects, even if those objects are non-numeric (such as people, animals, cars, etc). However, functions that accept actual numbers typically accept int, long, short or char arguments to represent whole numbers (integer values), float or double to represent real numbers (floating point values), or complex data types that are intrinsically numeric, such as std::complex objects.


What is datetypes?

datatype is a classification describing the type of the data. Eg:- Datatypes like float specifies the data to be floating point number, integer specifies the data to be a real number. It also specifies the possible values, default values, operations that can be carried on them.


When there is no relationship between two data sets when one set of data values increases while the other decreases?

negative correlation


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.


Why just check for negative input in validation?

Checking for negative input in validation is crucial because negative values can often lead to errors or unintended behavior in calculations, especially in contexts like financial data, quantities, or measurements where only non-negative values are valid. By validating against negative inputs, we ensure data integrity and avoid potential bugs or crashes in the application. Additionally, this check helps provide clear feedback to users, guiding them to input acceptable values.


What is the significance of a shift to the left in a graph or data set?

A shift to the left in a graph or data set indicates a decrease or a negative change in the values being represented. It can signify a decrease in a variable or a shift towards lower values.


What TYPES of return values are allowed?

Apart from basic Data types (int , char , float and double ) you can even return Class Objects.Nearly any type of Data can be returned by a function including pointers to void data type.


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.


Which is the wrapper class for the data type float?

The wrapper class for float is Float. java.lang.