Skip to main content
Engineering LibreTexts

18.10: Exercises

  • Page ID
    58431
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Below are some quiz questions and suggested projects based on this chapter.

    Quiz Questions

    Below are some quiz questions based on this chapter.

    1) Listthefloating-pointregisters.

    2) How many bytes are used by single precision floating-point values and how many bytes are used for double precision floating-point values?

    3) Explain why 0.1 added 10 times does not equal 1.0.

    4) Where is the result of a value returning floating-point function such as sin(x) returned?

    5) For a value returning floating-point function, which floating-point registers must be preserved across the function call?

    Suggested Projects

    Below are some suggested projects based on this chapter.

    1) Implement the example program to find the sum and average for a list of floating-point values. Use the debugger to execute the program and verify the final results.

    2) Implement the floating-point absolute value function as two macros, one fAbsf for 32-bit floating-point values and fAbsd for 64-bit floating-point values. Create a simple main program that uses each macro three times on various different values. Use the debugger to execute the program and verify the results.

    3) Implement a program to perform the summation:

    \[\sum_{i = 1}^{10} 0.1\nonumber\]

    Compare the results of the summation to the value 1.0 and display a message “Are Same” if the summation result equals 1.0 and the message “Are Not Same” if the result of the summation does not equal 1.0. Use the debugger as needed to debug the program. When working, execute the program without the debugger and verify that the expected results are displayed to the console.


    18.10: Exercises is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?