Question: Write a function mean, which follows the following specification: Input: a 0 , a 1 , a 2 , and a 3 contain ( signed
Write a function mean, which follows the following specification:
Input: a a a and a contain signed integers, with
Output: Return in a the arithmetic mean of the input values. If the mean is not an integer, round the number down.
Example: If a contains a contains a contains and a contains then the mean is
Thus, the expected output is
Example: If a contains a contains a contains and a contains then the mean is
Thus, the expected output is
Hint: RISCV standard does not have a division instruction or a multiplication instruction. However, some other instruction can be used to divide by certain numbers. What instruction is that?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
