Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 1.38 KB

README.md

File metadata and controls

15 lines (8 loc) · 1.38 KB

Sum and Average Calculator

As an exercise to explore the differences between integer and floating-point arithmetic in assembly, this program calculates the sums and averages of 10 imput integers using the CPU and 10 input floating-point numbers using the FPU. For both, the program first converts user input from strings to numbers while validating input, then calculates their sum and average, finally displaying formatted results for 10 input values.

🔶 Run Example - Integers

This portion of the program is fairly straightforward and is capable of processing the full range of 32-bit signed integers from -2,147,483,648 to 2,147,483,647. The most challenging aspect was parsing + and - signs from input, and the logic of deciding when to and when not to display them to the user (e.g., not -0 nor +0).

Calc_Integers-crop

🐟 Run Example - Floating Point Numbers

Using the FPU, this portion of the program accepts signed inputs with up to 5 decimal places. A very memorable lesson on floating-point arithmetic and floating-point errors. Working with the FPU and fixing rounding errors without looking much up was a challenging exercise.

Calc_FloatingPoint