calculator (Windows) - library API 1.1.1
calculator - Libraries
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
Coruh::Calculator::Calculator Class Reference

Provides Basic functions for various operations. More...

#include <calculator.h>

Collaboration diagram for Coruh::Calculator::Calculator:

Static Public Member Functions

static double add (double a, double b)
 
static double subtract (double a, double b)
 
static double multiply (double a, double b)
 
static double divide (double a, double b)
 

Detailed Description

Provides Basic functions for various operations.

Member Function Documentation

◆ add()

double Calculator::add ( double a,
double b )
static

Adds two numbers.

Parameters
aFirst operand.
bSecond operand.
Returns
The sum of a and b.

◆ divide()

double Calculator::divide ( double a,
double b )
static

Divides the first number by the second. Throws std::invalid_argument if the second number is zero.

Parameters
aDividend.
bDivisor.
Returns
The result of a / b.
Exceptions
std::invalid_argumentIf b is zero.

◆ multiply()

double Calculator::multiply ( double a,
double b )
static

Multiplies two numbers.

Parameters
aFirst operand.
bSecond operand.
Returns
The product of a and b.

◆ subtract()

double Calculator::subtract ( double a,
double b )
static

Subtracts the second number from the first.

Parameters
aMinuend.
bSubtrahend.
Returns
The result of a - b.

The documentation for this class was generated from the following files: