class Calculator

Defined at line 8 of file ./include/Calculator.h

A simple calculator class.

Provides basic arithmetic operations.

Public Members

int public_val
static const int static_val

Public Methods

int add (int a, int b)

Adds two integers.

Parameters

a First integer.
b Second integer.

Returns

int The sum of a and b.

Defined at line 3 of file ./src/Calculator.cpp

int subtract (int a, int b)

Subtracts the second integer from the first.

Parameters

a First integer.
b Second integer.

Returns

int The result of a - b.

Defined at line 7 of file ./src/Calculator.cpp

int multiply (int a, int b)

Multiplies two integers.

Parameters

a First integer.
b Second integer.

Returns

int The product of a and b.

Defined at line 11 of file ./src/Calculator.cpp

double divide (int a, int b)

Divides the first integer by the second.

Parameters

a First integer.
b Second integer.

Returns

double The result of a / b.

Throws

std::invalid_argument if b is zero.

Defined at line 15 of file ./src/Calculator.cpp

int mod (int a, int b)

Performs the mod operation on integers.

Parameters

a First integer.
b Second integer.

Returns

The result of a % b.

Defined at line 54 of file ./include/Calculator.h