← Back to Course

Lesson 50: Multiplying fixed-point numbers with unequal scaling factors

Practice Questions

Question 1: `x` is a fixed-point number with a scaling factor of 1e20. `y` is a fixed-point number with a scaling factor of 1e10. We want to multiply `x` and `y` and get a fixed-point number with a scaling factor of 1e18. Write the code that accomplishes this. Use scientific notation for constants and don't forget the semicolon.

Question 2: `x` is a fixed-point number with a scaling factor of 1e15. `y` is a fixed-point number with a scaling factor of 1e12. We want to multiply `x` and `y` and get a fixed-point number with a scaling factor of 1e18. Write the code that accomplishes this. Use scientific notation for constants and don't forget the semicolon.

Question 3: `x` is a fixed-point number with a scaling factor of 1e8. `y` is a fixed-point number with a scaling factor of 1e6. We want to multiply `x` and `y` and get a fixed-point number with a scaling factor of 1e18. Write the code that accomplishes this. Use scientific notation for constants and don't forget the semicolon.

Question 4: `x` is a fixed-point number with a scaling factor of 1e18. `y` is a fixed-point number with a scaling factor of 1e18. We want to multiply `x` and `y` and get a fixed-point number with a scaling factor of 1e18. Write the code that accomplishes this. Use scientific notation for constants and don't forget the semicolon.

Question 5: `x` is a fixed-point number with a scaling factor of 1e12. `y` is a fixed-point number with a scaling factor of 1e8. We want to multiply `x` and `y` and get a fixed-point number with a scaling factor of 1e20. Write the code that accomplishes this. Use scientific notation for constants and don't forget the semicolon.