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

Clean up mod1 #14140

Merged
merged 1 commit into from
Dec 4, 2015
Merged

Clean up mod1 #14140

merged 1 commit into from
Dec 4, 2015

Conversation

eschnett
Copy link
Contributor

Implement fld1 and fldmod1.
Add test cases.
Deprecate rem1.

@@ -185,6 +185,13 @@ end
@deprecate iround(x) round(Integer,x)
@deprecate iround{T}(::Type{T},x) round(T,x)

# rem1 is inconsistent for x==0: The result should both have the same
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be in the "0.5 deprecations" section at the end, not mixed in with the 0.4 deprecations

@eschnett
Copy link
Contributor Author

Updated.

@eschnett eschnett force-pushed the eschnett/mod1 branch 2 times, most recently from 63e3ccd to 3173fe3 Compare November 26, 2015 05:06
@kshyatt kshyatt added the maths Mathematical functions label Dec 2, 2015
@kshyatt
Copy link
Contributor

kshyatt commented Dec 2, 2015

@tkelman is this good to go?

@tkelman
Copy link
Contributor

tkelman commented Dec 2, 2015

No, the docs need to be populated into the RST

@kshyatt kshyatt added the needs docs Documentation for this change is required label Dec 2, 2015
@kshyatt
Copy link
Contributor

kshyatt commented Dec 2, 2015

Wonderful, a chance to use my new label.

@eschnett
Copy link
Contributor Author

eschnett commented Dec 3, 2015

Updated documentation.

@@ -164,11 +172,29 @@ Mathematical Operators

The floored quotient and modulus after division. Equivalent to ``(fld(x,y), mod(x,y))``\ .

.. function:: fld1(x,m)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it actually makes a difference but I think we usually put space after commas in argument list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So do I usually, but here I thought that this would make the tuple less readable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, I'm talking about the exact line I'm commenting on .. function:: fld1(x,m).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signature in rst needs to be consistent

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rst still needs a space

@@ -5266,6 +5266,8 @@ doc"""
%(x, y)

Remainder from Euclidean division, returning a value of the same sign as `x`, and smaller in magnitude than `y`. This value is always exact.

x == div(x,m)*m + rem(x,m)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's m ?

@eschnett
Copy link
Contributor Author

eschnett commented Dec 3, 2015

Corrected documentation.

@@ -3265,7 +3265,7 @@ tril!(M, k)
doc"""
divrem(x, y)

The quotient and remainder from Euclidean division. Equivalent to `(x÷y, x%y)`.
The quotient and remainder from Euclidean division. Equivalent to `div(x,y), rem(x,y))` or `(x÷y, x%y)`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing open paren

Implement fld1 and fldmod1.
Add test cases.
Deprecate rem1.
Simplify (the only) use case in Base.
Update documentation.
@eschnett
Copy link
Contributor Author

eschnett commented Dec 3, 2015

I'm learning a lot about the doc system here. I don't think that's the goal here, though. Thanks for the pointers and the patience.

@tkelman tkelman removed the needs docs Documentation for this change is required label Dec 3, 2015
@tkelman
Copy link
Contributor

tkelman commented Dec 3, 2015

yes, it's an open todo to make the docsystem less fiddly, the current system with partially autogenerated rst is not great.

docs lgtm now. not thrilled about adding more exports but i guess this is okay.

@eschnett
Copy link
Contributor Author

eschnett commented Dec 3, 2015

Note that rem1 is now deprecated, so overall the number of functions stays constant (kind of).

eschnett added a commit that referenced this pull request Dec 4, 2015
@eschnett eschnett merged commit 2e945b8 into JuliaLang:master Dec 4, 2015
@eschnett eschnett deleted the eschnett/mod1 branch December 4, 2015 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maths Mathematical functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants