-
Notifications
You must be signed in to change notification settings - Fork 49
Floating point emulation and Calculator Utility #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I can code review this |
|
I can code review this as well |
|
High Level Checks:
Code Checks:
Overall, this code seems good, though I would recommend a few changes. First, make sure to add more documentation, perhaps in the form of comments explaining what is happening for some of the bit shifts. Additionally, modify the calculator so it does not give a user trap if there are no arguments provided. Relatedly, if the program is not provided with all the required arguments, output a helpful message telling users what inputs are expected, rather than providing no output at all. Finally, I would make the calculator handle integers better, compared to how it is currently done. For example, with inputs like 127.091 * 3, the result given was 55.557729, which is incorrect; the result should be closer to what is given when both numbers are floats(e.g., 127.091 * 3.0 gives 381.273). While this is not a major issue since you specifically mentioned it, changing it would improve the usability, by addressing a minor inconvenience people might run into. |
|
High Level Checks:
Code Checks:
All in all the PR successfully implements a basic float calculator utility in XV6 with the usual calculator operations. The code as a whole is well formatted with only minor deviations from XV6's formatting but it is consistent. It is a good addition to XV6 and easy to see its benefits. The only improvements I can see that can be added are documentation, tests, and fixing bugs. Javadocs can be added to better explain how functions work. Finally, there are several bugs that cause the calculator to freeze and lock up, such as if the result is an integer (i.e 9.9+1.1) and if 0.0 is included in multiplication or division operation. But overall, this is a great addition and utility for XV6. |
|
This is one that I wasn't sure if it would work out given the complexity, but you did it! Very cool. I do see the rough edges the CRs above found. The test program / calculator has some issues, but the library itself seems to be quite solid. Really, the main thing here would be fleshing out the calculator so it's a bit more fully featured (in its current state it feels more like a proof of concept), but that would be a great future project for someone else to pick up. EDIT: I realize you have a pending commit to fix some of the issues. I'll check that out once it's up. Very nice work. This was quite ambitious and a super cool contribution. |
Implementation of software based floating point emulation and Calculator Utility to test implemented floating point numbers. For calculator utility, the format is:
Floating point numbers must be inputted in a decimal format, for example "1330.39" or "2929.0." Keep this in mind. Allowed operations are <+, -, /, *> (addition, subtraction, division, multiplication). Future operations like square roots and exponentials are planned. These floating-point numbers DO NOT use IEEE standard for floating point numbers. As a result, we have a wider range of floating-point numbers. I hope future students who need floating point numbers for projects will enjoy what I made.