IVS-calculator
Loading...
Searching...
No Matches
mathlib.h
Go to the documentation of this file.
1
6#ifndef MATHLIB_H
7#define MATHLIB_H
8
9namespace mathlib {
10
18
19// Basic operations
20
27double add(double a, double b);
28
35double subtract(double a, double b);
36
43double multiply(double a, double b);
44
52double divide(double a, double b, MathError &err);
53
54// Advanced operations
55
62double factorial(int a, MathError &err);
63
70double power(double base, int exp);
71
79double root(double base, int n, MathError &err);
80
88double modulo(double a, double b, MathError &err);
89
90} // namespace mathlib
91
92#endif
double root(double base, int n, MathError &err)
Implementation of function root.
Definition mathlib.cpp:85
double add(double a, double b)
Implementation of function add.
Definition mathlib.cpp:9
double multiply(double a, double b)
Implementation of function multiply.
Definition mathlib.cpp:25
double modulo(double a, double b, MathError &err)
Implementation of function modulo.
Definition mathlib.cpp:111
MathError
Definition mathlib.h:11
@ INVALID_ROOT
Definition mathlib.h:15
@ NEGATIVE_FACTORIAL
Definition mathlib.h:14
@ DIVISION_BY_ZERO
Definition mathlib.h:13
@ INVALID_ARGUMENT
Definition mathlib.h:16
double divide(double a, double b, MathError &err)
Implementation of function divide.
Definition mathlib.cpp:33
double subtract(double a, double b)
Implementation of function subtract.
Definition mathlib.cpp:17
double factorial(int a, MathError &err)
Implementation of function factorial.
Definition mathlib.cpp:47
double power(double base, int exp)
Implementation of function power.
Definition mathlib.cpp:67