semvec/pypi-packages huggingface dataset:
simplemathx 1.0.0
Simple math library with basic functions and advanced features like power, sqrt, average, and absolute.
Requires Python: >=3.6

# simpleMathX

Simple math library with basic functions: addition, subtraction, multiplication, and division.

## Installation

```bash
pip install simplemathx
```

## Usage

```python
from simplemathx import add, subtract, multiply, divide, power, sqrt, average, absolute

def main():
    print("Add:", add(5, 3))
    print("Subtract:", subtract(5, 3))
    print("Multiply:", multiply(5, 3))
    print("Divide:", divide(10, 2))
    print("Power:", power(2, 3))
    print("Sqrt:", sqrt(16))
    print("Average:", average(1, 2, 3, 4, 5))
    print("Absolute:", absolute(-10))

    try:
        print("Divide by zero:", divide(10, 0))
    except ValueError as e:
        print("Error:", e)

    try:
        print("Sqrt negative:", sqrt(-1))
    except ValueError as e:
        print("Error:", e)

if __name__ == "__main__":
    main()
```

## Explanation

- `add(a, b)`: Returns the sum of `a` and `b`.
- `subtract(a, b)`: Returns the difference of `a` and `b`.
- `multiply(a, b)`: Returns the product of `a` and `b`.
- `divide(a, b)`: Returns the quotient of `a` divided by `b`. Raises a `ValueError` if `b` is zero.

## License

This project is licensed under the terms of the [MIT License](LICENSE).