Computer Arithmetic

On some processors, computations involving many subnormal numbers can slow down dramatically. Which setting is used when performance takes priority?

  1. ATreating subnormal results and inputs as zero (flush-to-zero)
  2. BAutomatically converting all computation from double to single precision
  3. CStopping the program whenever a subnormal is found
Show answer and explanation

Answer: A. Treating subnormal results and inputs as zero (flush-to-zero)

Subnormals are a special form without an implied leading 1, so some processors cannot handle them in fast hardware and fall back to microcode or similar, running tens of times slower. Where values extremely close to zero need not be handled precisely, as in audio processing or AI, a flush-to-zero setting treats subnormals as zero to keep speed. The cost is lost precision near zero and loss of gradual underflow. It neither changes precision across the board nor stops the program.

  • A. Correct. Treating subnormals as zero avoids the slowdown.
  • B. It is not a setting that changes precision across the board.
  • C. Stopping the program would halt the computation.
Practice this topic Back to topic

More Computer Arithmetic questions

  1. Under IEEE 754, what result does the standard specify for dividing a positive number by zero?
  2. When x is NaN, what does evaluating x == x give in most programming languages?
  3. In IEEE 754 single precision, what do bit patterns with an all-ones exponent field (255) represent?
  4. Which correctly describes +0 and −0 in IEEE 754 floating point?
  5. Which rounding method does IEEE 754 specify as the default?