answersLogoWhite

0

How do you verify the range of variable in c?

Updated: 8/21/2019
User Avatar

Wiki User

7y ago

Best Answer

The range for all the integral types in C are implementation-defined. To ascertain the range for a specific implementation, include the <limits.h> header where the following macros are defined:

CHAR_BIT Number of bits in a char object (byte).

SCHAR_MIN Minimum value for an object of type signed char.

SCHAR_MAX Maximum value for an object of type signed char.

UCHAR_MAX Maximum value for an object of type unsigned char.

CHAR_MIN Minimum value for an object of type char.

CHAR_MAX Maximum value for an object of type char.

MB_LEN_MAX Maximum number of bytes in a multibyte character for any locale.

SHRT_MIN Minimum value for an object of type short int.

SHRT_MAX Maximum value for an object of type short int.

USHRT_MAX Maximum value for an object of type unsigned short int.

INT_MIN Minimum value for an object of type int.

INT_MAX Maximum value for an object of type int.

UINT_MAX Maximum value for an object of type unsigned int.

LONG_MIN Minimum value for an object of type long int.

LONG_MAX Maximum value for an object of type long int.

ULONG_MAX Maximum value for an object of type unsigned long int.

LLONG_MIN Minimum value for an object of type long long int.

LLONG_MAX Maximum value for an object of type long long int.

ULLONG_MAX Maximum value for an object of type unsigned long long int.

Similarly, include the <float.h> header for the range of all floating-point types.

FLT_RADIX Base for all floating-point types (float, double and long double).

FLT_MANT_DIG

DBL_MANT_DIG

LDBL_MANT_DIG Precision of significand, i.e. the number of digits that conform the significand.

FLT_DIG

DBL_DIG

LDBL_DIG Number of decimal digits that can be rounded into a floating-point and back without change in the number of decimal digits.

FLT_MIN_EXP

DBL_MIN_EXP

LDBL_MIN_EXP Minimum negative integer value for the exponent that generates a normalized floating-point number.

FLT_MIN_10_EXP

DBL_MIN_10_EXP

LDBL_MIN_10_EXP Minimum negative integer value for the exponent of a base-10 expression that would generate a normalized floating-point number.

FLT_MAX_EXP

DBL_MAX_EXP

LDBL_MAX_EXP Maximum integer value for the exponent that generates a normalized floating-point number.

FLT_MAX_10_EXP

DBL_MAX_10_EXP

LDBL_MAX_10_EXP Maximum integer value for the exponent of a base-10 expression that would generate a normalized floating-point number.

FLT_MAX

DBL_MAX

LDBL_MAX Maximum finite representable floating-point number.

FLT_EPSILON

DBL_EPSILON

LDBL_EPSILON Difference between 1 and the least value greater than 1 that is representable.

FLT_MIN

DBL_MIN

LDBL_MIN Minimum representable floating-point number.

FLT_ROUNDS Rounding behavior. Possible values:

-1 undetermined

0 toward zero

1 to nearest

2 toward positive infinity

3 toward negative infinity

Applies to all floating-point types (float, double and long double).

FLT_EVAL_METHOD Properties of the evaluation format. Possible values:

-1 undetermined

0 evaluate just to the range and precision of the type

1 evaluate float and double as double, and long double as long double.

2 evaluate all as long double Other negative values indicate an implementation-defined behavior.

Applies to all floating-point types (float, double and long double).

DECIMAL_DIG Number of decimal digits that can be rounded into a floating-point type and back again to the same decimal digits, without loss in precision.

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you verify the range of variable in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which term does not fit into this list of terms a. domain b. range c. input d. independent variable?

an independent variable


What is Variable Scope?

The scope of a variable is the range, or area, in which a variable exists. // this c is global and can be referenced from anywhere int c = 1; void foo() { // this c is local to function foo and can't be referenced from the outside int c = 2; } void bar() { // if we try to reference c here, we get the value 1 from the global variable }


The statement to verify the relationship between interleukin and fatigue and dependent variable or independent variable?

Independent Variable: interleukin and fatigue Dependent Variable: the relationship -----inferential statistics


C plus plus most accurate and largest range number variable?

double (or, on some platforms, long double)


When an experiment showes that one variable makes another variable change and no other variable has any effect what is the experiment showing?

causation


In a graph what is the variable on the horizontal axis?

Independent Variable c:


What does c x b mean?

The variable c times the variable b simply equals cb. Just as the variable x times the variable y would equal xy, and so on.


What is the variable of a cloud?

c


What variable represents specific heat in the equation mcT?

variable c


What range of values was used for your independent variable?

From the minimum value of the independent variable to its maximum.


What is the output variable of a function?

It is a value in the co-domain [range] of the function.


How does the manipulation of an independent variable during a scientific experiment allow a scientist to find a cause-and-effect relationship between variables?

The independent variable, or manipulating variable always affect the outcome of a dependent, or responsive, variable. For example, i have a fire going, and i want to put it out. I could use a range of materials. The range of materials is the independent variable, while the fire going out or not is the dependent variable. This shows a cause and effect.