Simple Math Utils
一个简单的数学工具库,提供基本的数学运算功能。
功能特点
- 提供基本的数学运算:加法、减法、乘法、除法
- 内置类型提示支持
- 详细的文档和示例
- 完整的测试覆盖
- 健壮的错误处理和日志记录
安装
使用pip安装:
pip install dongjak-math-utils
使用方法
基本用法
from simple_math_utils import add, subtract, multiply, divide
# 基本运算
result = add(10, 5) # 15
result = subtract(10, 5) # 5
result = multiply(10, 5) # 50
result = divide(10, 5) # 2.0
# 支持浮点数
result = add(3.14, 2.71) # 5.85
高级用法
# 链式操作
result = divide(multiply(add(10, 5), subtract(8, 3)), 2)
# 等同于 ((10 + 5) * (8 - 3)) / 2 = 37.5
开发
环境设置
- 克隆仓库
- 创建并激活虚拟环境
- 安装开发依赖
git clone https://github.com/yourusername/dongjak-math-utils.git
cd dongjak-math-utils
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # Linux/Mac
pip install -e ".[dev]"
运行测试
pytest
许可证
MIT
项目结构
dongjak_math_utils/
├── dongjak_math_utils/ # 主库目录
│ ├── __init__.py # 导出公共API
│ ├── core.py # 核心功能
├── tests/ # 测试目录
│ └── test_core.py # 核心功能测试
└── examples/ # 示例目录
└── basic_usage.py # 基本用法示例
Metadata
Release files for dongjak-math-utils 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dongjak_math_utils-0.1.0.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dongjak_math_utils-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / dongjak_math_utils-0.1.0.tar.gz
| Download URL | dongjak_math_utils-0.1.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a0b4bc0ebab3312db7b180309ab38ea31dae1137d74aff8cb20aa22f157533b
|
|
BLAKE2b-256 checksum How to use checksums |
09ebf9c07db18a7f382df977cb2e4b9db3a35e02866b468196baf308651a9f77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.28.1
|
Release files / dongjak_math_utils-0.1.0-py3-none-any.whl
| Download URL | dongjak_math_utils-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1338904bb3d2405417de3c6ee19160ace83ea5ff326f83b4362836e1835eb14
|
|
BLAKE2b-256 checksum How to use checksums |
c94eaf701616531b3f8fce039bbedf6bed50f109723db08df8548d6680912f54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.28.1
|