answersLogoWhite

0


Best Answer

Of course, you should have tested:

float x= -1.0;

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Does float data type accept negative values?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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

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.


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.


What are the four scalar types of PHP?

Four scalar types of PHPStringString is used for binary data. This can be text, content of an image file etc.$today = 'hey how are you';IntFor numeric values, Int is used. Int can contain a positive or a negative number.$total = 20000000;$temperature = -14 ;FloatFloat is used for numbers that have a fractional component. Float can also contain positive or negative values.$length = 145.78;$growthRate = -5.216;Sometimes name Double is used for Float values.BooleanBoolean is used for values that are either true or false. You would often see Boolean values in conditional statements.if (($age > 12) && ($age < 20)) {$teenage = true;} else {$teenage = false;}//Some content goes hereif ($teenage) {}


Which is the wrapper class for the data type float?

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


Is the standrad deviation of the data values in a sample is 17 what is the variance of the data values?

is the standrad deviation of the data values in a sample is 17 what is the variance of the data values


Why float is not declared as int in java?

Because float is used for storing floating point numbers (values with decimal points and fractions) whereas int is used to store integer numbers (whole number) Storing a float in a int will result in loss of data which is not desirable and hence it is not done.