Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add more tests to divRound with negative numbers#174

Open
axic wants to merge 1 commit into
indutny:masterfrom
axic:round-negative
Open

Add more tests to divRound with negative numbers#174
axic wants to merge 1 commit into
indutny:masterfrom
axic:round-negative

Conversation

@axic

@axic axic commented Feb 2, 2018

Copy link
Copy Markdown
Contributor

No description provided.

@axic

axic commented Feb 2, 2018

Copy link
Copy Markdown
Contributor Author

These tests actually fail, because contrary to the name, the code seems to be rounding to ceiling. Is it supposed to be like that?

This was my first step at fixing #79. Modified divRound as: a.divRound(b, mode) - rounded division (mode can be set to round (default), floor or ceil)

@dcousens

dcousens commented Feb 2, 2018

Copy link
Copy Markdown
Contributor

@axic ceiling? or towards 0 for negatives?

@dcousens dcousens added the bug label Feb 2, 2018
@axic

axic commented Feb 2, 2018

Copy link
Copy Markdown
Contributor Author

Towards zero for negatives.

@dcousens

dcousens commented Jun 6, 2018

Copy link
Copy Markdown
Contributor

@axic what is left to do here? Do you have time?

@axic

axic commented Jul 17, 2018

Copy link
Copy Markdown
Contributor Author

I don't particularly have a lot of time, but I guess this PR could be changed to add tests for the current behaviour and update documentation to reflect that.

A separate PR could change behaviour as that is breaking - well, it could be just a bug too, if the document is to be the canon. Any opinions @indutny ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants