UniqCalculator is a simple Ruby gem that provides basic arithmetic operations such as addition, subtraction, multiplication, and division — ideal for lightweight use in Ruby apps or teaching purposes.
- ✅ Add, subtract, multiply, and divide numbers
- 🛡️ Handles division-by-zero with proper error handling
- 📦 Lightweight and easy to integrate
Add this line to your Gemfile:
gem 'uniq_calculator'
Install the gem and add to the application's Gemfile by executing:
bundle install
Or install it yourself as:
gem install uniq_calculator
require 'uniq_calculator'
calculator = CalculatorGem::Calculator.new
puts calculator.add(5, 3) # => 8
puts calculator.subtract(10, 4) # => 6
puts calculator.multiply(3, 4) # => 12
puts calculator.divide(10, 2) # => 5.0
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/uniq_calculator.