Professional C calculator application demonstrating robust programming practices, comprehensive error handling, and mathematical operations with proper validation.
Version-Control-GitHub-and-C-Programming-Bug-Fixes/
├── src/
│ └── calculator.c # Main calculator implementation
├── bin/ # Compiled executable
├── Makefile # Build configuration
└── README.md # This file
- Addition - Safe addition with overflow detection
- Subtraction - Safe subtraction with overflow detection
- Multiplication - Safe multiplication with overflow detection
- Division - Division with zero-division protection
- Power - Exponentiation with domain validation
- Square Root - Square root with negative number protection
- Comprehensive input validation
- Overflow and underflow detection
- Domain error checking (negative square roots, etc.)
- Buffer overflow protection
- Graceful error handling
- Professional menu system
- Clear operation prompts
- Detailed error messages
- Interactive operation loop
- GCC compiler (C11 standard)
- Make utility
- Math library (libm)
# Build the calculator
make all
# Or specifically
make calculator
# Clean build artifacts
make clean./bin/calculator ********************************
** Professional Calculator **
** BCS Edition **
** Author: Jaden Mardini **
********************************
Available Operations:
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Power (x^y)
6. Square Root
7. Exit
Enter operation number (1-7): 1
=== Addition ===
Enter first number: 15.5
Enter second number: 24.3
Result: 15.500000 + 24.300000 = 39.800000
- Input validation for all user inputs
- Mathematical domain checking
- Overflow/underflow detection
- Clear error messages with guidance
- C11 standard compliance
- Professional naming conventions
- Comprehensive documentation
- Modular function design
- Proper floating-point arithmetic
- Domain validation for all operations
- Infinity and NaN detection
- Precision-aware calculations
- Fixed inconsistent data types (double vs int)
- Added proper input validation
- Implemented overflow protection
- Added missing return type for main()
- Expanded from 2 to 6 mathematical operations
- Professional user interface
- Comprehensive error handling
- Interactive operation loop
- Safe input reading with buffer protection
- Professional documentation
- Consistent coding style
- Modular design
- Proper memory management
- Safety First - All operations validated for safety
- User Experience - Clear prompts and error messages
- Robustness - Handles all edge cases gracefully
- Maintainability - Clean, documented code
- Professional Standards - Industry best practices
This project is for fun ;)