Skip to content

Add more tests to divRound with negative numbers#174

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

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

Conversation

@axic
Copy link
Contributor

@axic axic commented Feb 2, 2018

No description provided.

@axic
Copy link
Contributor Author

axic commented Feb 2, 2018

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
Copy link
Contributor

dcousens commented Feb 2, 2018

@axic ceiling? or towards 0 for negatives?

@dcousens dcousens added the bug label Feb 2, 2018
@axic
Copy link
Contributor Author

axic commented Feb 2, 2018

Towards zero for negatives.

@dcousens
Copy link
Contributor

dcousens commented Jun 6, 2018

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

@axic
Copy link
Contributor Author

axic commented Jul 17, 2018

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