Skip to content

🐛 [Bug]: Multiple logic and UI edge cases in Ultra Pro Calculator #399

@Sanjhivvarshan-b-s

Description

@Sanjhivvarshan-b-s

📝 Description

While testing the "Ultra Pro Calculator" on the web app, I found several logic and UI bugs. Specifically:

  1. The "Error" State Trap: Appending numbers to an "Error" state breaks the calculator.
  2. Scientific Function Crash: Pressing sin, cos, etc., on an incomplete expression (like 5+) throws an evaluation error.
  3. Radian vs Degree: Trigonometry functions calculate in radians instead of degrees.
  4. Visual Symbol Mismatch: The UI displays * and / instead of × and ÷.
    and more

🔄 Steps to Reproduce

For the "Error" trap:

  1. Go to the Web App and open the Ultra Pro Calculator.
  2. Enter an invalid calculation (e.g., 5 ÷ 0 = or + =) to trigger the "Error" screen.
  3. Press the number 5.
  4. See Error5 on the display.

For the Radian bug:

  1. Clear the calculator.
  2. Press 9, 0, and then sin.
  3. See incorrect output.

For the Visual bug:

  1. Press 5, ×, 5.
  2. See 5*5 on the display instead of 5×5.

🎯 Expected Behavior

  • If the screen displays "Error", pressing a new number should clear the screen first.
  • Pressing sin after typing 90 should output 1 (calculating in degrees, not radians).
  • Pressing the multiplication or division buttons should visually display × and ÷ on the screen.

❌ Actual Behavior / Error Logs

  • The calculator concatenates strings to the error message (e.g., "Error5").
  • sin(90) outputs 0.8939966636005579 (calculated in radians).
  • The display shows programmer symbols (*, /) instead of standard math symbols.
  • Passing incomplete expressions (like 5+) to scientific functions throws a silent JavaScript runtime error and fails to update the UI.

💻 Environment

  • OS: Any (Browser-based)
  • Python Version: N/A (JavaScript Web App)
Image Image
  • File Name: calculator.js

  • I am a registered GSSoC 2026 contributor.
  • I want to be assigned to fix this issue.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions