antonienko/positive-modulus 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

antonienko/positive-modulus

最新稳定版本:v1.0

Composer 安装命令:

composer require antonienko/positive-modulus

包简介

Modulus returning always positive numbers

README 文档

README

Build Status

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.

统计信息

  • 总下载量: 2.79k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固