Calculator API
src.api.calculator
add(a, b)
Endpoint to add two numbers.
PARAMETER | DESCRIPTION |
---|---|
a
|
The first number to add.
TYPE:
|
b
|
The second number to add.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
The result of the addition. |
Source code in src/api/calculator.py
subtract(a, b)
Endpoint to subtract two numbers.
PARAMETER | DESCRIPTION |
---|---|
a
|
The number to subtract from.
TYPE:
|
b
|
The number to subtract.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
The result of the subtraction. |
Source code in src/api/calculator.py
multiply(a, b)
Endpoint to multiply two numbers.
PARAMETER | DESCRIPTION |
---|---|
a
|
The first number to multiply.
TYPE:
|
b
|
The second number to multiply.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
The result of the multiplication. |
Source code in src/api/calculator.py
divide(a, b)
Endpoint to divide two numbers.
PARAMETER | DESCRIPTION |
---|---|
a
|
The numerator.
TYPE:
|
b
|
The denominator.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
The result of the division. |
RAISES | DESCRIPTION |
---|---|
HTTPException
|
If division by zero is attempted. |