antonienko/positive-modulus
Composer 安装命令:
composer require antonienko/positive-modulus
包简介
Modulus returning always positive numbers
README 文档
README
Php modulus operator %, when working with negative numbers will return negative results.
People with a mathematical background sometimes would expect that modulus is always positive.
That's the case when you are trying to iterate on a set of elements by decrementing the iterator, when you reach -1, you want the modulus operation to give you the highest number again to continue the iteration on the last element.
After some research, I found that both behaviours could be mathematically correct, so this library is for those who need a modulus that always returns a positive result.
##Installation ###Composer This library is available in packagist.org, you can add it to your project via Composer.
In the "require" section of your composer.json file:
Always up to date (bleeding edge, API not guaranteed stable)
"antonienko/positive-modulus": "dev-master"
Specific minor version, API stability
"antonienko/positive-modulus": "0.2.*"
If you have any problems with the minimum-stability setting try appending @dev to the version
"antonienko/positive-modulus": "0.2.*@dev"
##Sample Usage
PositiveModulus::calc($a, $b);
##License Information Lincensed under The MIT License (MIT). See the LICENSE file for more details.
antonienko/positive-modulus 适用场景与选型建议
antonienko/positive-modulus 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.79k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 06 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「math」 「modulus」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 antonienko/positive-modulus 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 antonienko/positive-modulus 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 antonienko/positive-modulus 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LaTeX formula to PNG
Partition problem for balanced arrays splitting made easy.
Simple, chainable calculation library.
Easy to use arithmetic operations for decimals in PHP (using BCMath)
Core logic for elegant graphic visualization. Render to SVG, PNG, JPG and Base64.
Mandelbrot set simple PHP Generator.
统计信息
- 总下载量: 2.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-06-15