Floats and Ints once again M6 Test

  1. 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
  2. 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
  3. 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
  4. 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
  5. Assuming that the STDC FENV_ACCESS is set to ON, 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
  6. 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
  7. 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
  8. The difference between doubles and floats lies in the fact that:

    • doubles have a wider range
    • doubles have a wider range and offer better precision
    • doubles are faster
    • doubles offer better precision
  9. 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
  10. 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
  11. Dividing a non-zero float value by a zeroed float value produces:

    • -inf result
    • a NaN result 
    • +inf result
    • abnormal program termination
  12. The symbol named PRIdMAX is designed to be used by:

    • the printf() function
    • the scanf() function
    • the gets() function
    • the puts() function
  13. 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
  14. The longest part of a float values is its:

    • sign
    • significand
    • exponent
    • all parts are of equal size
  15. Assuming that the x variable is of type float, the following condition:

    x == x + 1.
    • is always false
    • is always true
    • is invalid
    • is unpredictable
  16. The rounding mode may be changed by  means of the:

    • roundmode() function
    • setround() function 
    • feroundmode() function
    • fesetround() function
  17. The function mpf_set() is used by the GMP library to copy:

    • a regular float variable to a multi-precision float variable
    • a regular float variable to a regular double variable
    • a multi-precision float variable to another variable
    • a multi-precision float variable to a regular float variable
  18. 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/stdoutstreams
  19. Dividing​ a zeroed float value by a zeroed float value produces:

    • -inf result
    • NaN result
    • a +inf result
    • abnormal program termination
  20. To output a 32-bit unsigned int value as a hex number, some would use the following portable specifier:

    • PRIuMAX
    • "%32bx"
    • PIRx32
    • "%32x"
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments