Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a fmod function that can give the modulo of two real numbers #13

Merged
merged 2 commits into from
Oct 11, 2017

Conversation

Sander-Toonen
Copy link
Contributor

See this thread on Stackoverflow:

Before PHP 7.2, bcmod does not handle real numbers well. There is no alternative function to PHP's native fmod in BC Math.

I added a function called BC::fmod that can give the remainder after "divving" two real numbers. In theory this function can replace the ''mod''-function, especially since it mimics the behaviour of bcmod from PHP 7.2. However creating a separate function minimises the risk of introducing problems with users that might falsely rely on the current behaviour.

@krowinski krowinski merged commit d3f1782 into krowinski:master Oct 11, 2017
@krowinski
Copy link
Owner

Tx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants