pyjc.cal package

Submodules

pyjc.cal.add module

pyjc.cal.add.add(a, b)[source]

Add two numbers and return the result.

Parameters:a, b (numeric like)
Returns:out
Return type:numeric like

Examples

>>> add(2, 3)
5
>>> add(-2, 10)
8
>>> add(2., 3)
5.0
>>> add(-2., 10)
8.0

pyjc.cal.divide module

pyjc.cal.divide.divide(a, b)[source]

Divide a from b, and return the result.

Parameters:a, b (numeric like)
Returns:out
Return type:numeric like
>>> divide(3, 2)
1.5
>>> divide(10, -2)
-5.0
>>> divide(3., 2)
1.5
>>> divide(10., -2)
-5.0

pyjc.cal.multiply module

pyjc.cal.multiply.multiply(a, b)[source]

Multiply a and b, and return the result.

Parameters:a, b (numeric like)
Returns:out
Return type:numeric like
>>> multiply(3, 2)
6
>>> multiply(10, -2)
-20
>>> multiply(3., 2)
6.0
>>> multiply(10, -2.)
-20.0

pyjc.cal.subtract module

pyjc.cal.subtract.subtract(a, b)[source]

Subtract b from a, and return the result.

Parameters:a, b (numeric like)
Returns:out
Return type:numeric like
>>> subtract(2, 3)
-1
>>> subtract(-2, 10)
-12

Module contents

pyjc.cal

Contains toy calculation utilities, such as add, divide, multiply, and subtract.

To call the function pyjc.cal.add.add(), simply do a pyjc.cal.add() (i.e. skip the module name)