一个简单的数学工具库
Project description
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 # 基本用法示例
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dongjak_math_utils-0.1.0.tar.gz.
File metadata
- Download URL: dongjak_math_utils-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a0b4bc0ebab3312db7b180309ab38ea31dae1137d74aff8cb20aa22f157533b
|
|
| MD5 |
7c0aa1e09f2b946c4f4f3a8ca092eeca
|
|
| BLAKE2b-256 |
09ebf9c07db18a7f382df977cb2e4b9db3a35e02866b468196baf308651a9f77
|
File details
Details for the file dongjak_math_utils-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dongjak_math_utils-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1338904bb3d2405417de3c6ee19160ace83ea5ff326f83b4362836e1835eb14
|
|
| MD5 |
5df1d436e23de4d2d1f7d250b8935025
|
|
| BLAKE2b-256 |
c94eaf701616531b3f8fce039bbedf6bed50f109723db08df8548d6680912f54
|