The website serves as a decimal-32 floating-point converter, capable of processing decimal inputs in base-10 exponential format and converting them into binary and hexadecimal forms. The 32-bit value is partitioned into 1 bit for the sign, 5 bits for the combination field, 6 bits for the exponent continuation, and 20 bits for the coefficient continuation. Special cases such as NaN and Infinity are also detected and converted. Access the website through this link
- Check if input is valid
- Normalize the input
- Shift input (if possible)
- Choose rounding method
- Get Sign Bit from input
- Get Combinational Field from input
- Get Exponent Continuation from input
- Convert remaining input to Densely Packed BCD
- Compile and Display
Explanation: Some of the floating point numbers were represented differently when operations were performed. For example, 0.5 minus 0.4 resulted in 0.09999999999999964.
Fix: The input was taken as a string instead of an integer.
Explanation: Since the inputs are stored as strings, rounding '9' up to '10' was a challenge
Fix: The input was first parsed into an integer before incrementing. Afterwards, it will be parsed back into a string.
Explanation: Exponents with floating points are being rounded and converted.
Fix: The convert button is disabled when there is a radix point in the input.
Explanation: If the input is larger than a certain number, it is not being represented properly.
Fix: When the number is too large, 'Infinity' is shown instead of the actual value.
Explanation: Inputs with white spaces are being accepted as they are not marked as NaN by JavaScript's isNaN function.
Fix: Self-created checker for white spaces were made.
Explanation: Some inputs are still representable even if the exponent is greater than 90. For example, 1 x 10^91 can be represented as 10 x 10^90.
Fix: A checker was created to verify if there are '0's on the left side that can be truncated so that a '0' can be added on the right side.
Decimal: Base-10 Number
Exponent: Base-10 Number (No Floating Points)
Rounding mode: Truncate/Floor/Ceiling/RTN-TE
Rounded number: 7-Digit Base-10 Number
Exponent after rounding: Base-10 Number (w/o Bias)
Binary Form: 32-Bit Conversion of the Input
Hexadecimal Form: 8-Digit Hexadecimal Conversion of the Input
The video demo may also be accessed through this link
Access the test cases here
- Cabrera, Jean
- Cabrera, Alyanna
- Lu, Bentley
- Tan, Arvin