Floats and Ints once again M6 Test
-
The three parts of a
float
value are deployed in the following order:- sign, exponent, significand
- exponent, sign, significand
- exponent, significand, sign
- sign, significand, exponent
-
Removing the letter
f
from both literals used in the following expression:printf("%f", 43210.f + .56789f);
- will cause a compilation error
- won’t change the value printed to
stdout
- is illegal
- will change the value printed to
stdout
-
The number of significant digits stored in a
float
value:- is smaller the larger the value is
- is bigger the smaller the value is
- changes randomly
- depends on the value’s precision
-
The length of a
double
type variable:- is defined by the IEEE 754 standard
- is defined by the “C” language standards
- is hardware-dependent
- is user-defined
-
Assuming that the
STDC FENV_ACCESS
is set toON
, the result of the following expression showing five digits after the decimal point:float f = 8.f / 9.f;
- depends on the rounding mode currently set
- depends on the hardware platform
- is always
0.88888
- is always
0.88889
-
A normalized
float
value:- has the highest significand’s bit set to
0
- has the highest significand’s bit set to
1
- has the highest exponent’s bit set to
1
- has the highest exponent’s bit set to
0
- has the highest significand’s bit set to
-
The absolute values of numbers representable in a 32-bit IEEE 754 number come from the range:
1.175494e-38 .. +inf
1.175494e-38 .. 3.402823e+38
.. +inf
0.0 ..3.402823e+38
-
The difference between
doubles
andfloats
lies in the fact that:doubles
have a wider rangedoubles
have a wider range and offer better precisiondoubles
are fasterdoubles
offer better precision
-
The GMP library uses the
mpz_t
type to represent:- multi-precision
float
values - multi-precision integer values
- multi-precision
double
values - multi-precision rational values
- multi-precision
-
If you put a pin in a random place of a number line, the distance to the closes table
float
value is:- equal to half of the ULP
- greater than the ULP
- equal to the ULP
- not greater than half of the ULP
-
Dividing a non-zero
float
value by a zeroedfloat
value produces:- a
-inf
result - a
NaN
result - a
+inf
result - abnormal program termination
- a
-
The symbol named
PRIdMAX
is designed to be used by:- the
printf()
function - the
scanf()
function - the
gets()
function - the
puts()
function
- the
-
The
FE_TOWARDZERO
rounding mode can make:- positive numbers bigger and negative numbers smaller
- positive numbers smaller while negative numbers remain untouched
- positive numbers smaller and negative numbers bigger
- negative numbers bigger while positive numbers remain untouched
-
The longest part of a
float
values is its:- sign
- significand
- exponent
- all parts are of equal size
-
Assuming that the
x
variable is of typefloat
, the following condition:x == x + 1.
- is always false
- is always true
- is invalid
- is unpredictable
-
The rounding mode may be changed by means of the:
roundmode()
functionsetround()
functionferoundmode()
functionfesetround()
function
-
The function
mpf_set()
is used by the GMP library to copy:- a regular
float
variable to a multi-precisionfloat
variable - a regular
float
variable to a regulardouble
variable - a multi-precision
float
variable to another variable - a multi-precision
float
variable to a regularfloat
variable
- a regular
-
The type named
int_fast8_t
is designed to choose the fastest:- of all possible integer arithmetic implementations
- floating-point routines
- way of compiling integer expressions
- method of transmitting integer values through
stdin/stdout
streams
-
Dividing a zeroed
float
value by a zeroedfloat
value produces:- a
-inf
result - a
NaN
result - a +inf result
- abnormal program termination
- a
-
To output a 32-bit unsigned
int
value as a hex number, some would use the following portable specifier:PRIuMAX
"%32bx"
PIRx32
"%32x"
Subscribe
0 Comments
Newest