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 max, min, and abs. #11

Merged
merged 2 commits into from
Mar 14, 2018
Merged

Add max, min, and abs. #11

merged 2 commits into from
Mar 14, 2018

Conversation

willtebbutt
Copy link
Member

What the title says.

src/rules.jl Outdated
@@ -60,6 +60,7 @@
@define_diffrule Base.lgamma(x) = :( digamma($x) )
@define_diffrule Base.Math.JuliaLibm.log1p(x) = :( inv($x + 1) )
@define_diffrule Base.transpose(x) = :( 1 )
@define_diffrule Base.abs(x) = :( $x > 0 ? one($x) : -one($x) )
Copy link
Member

Choose a reason for hiding this comment

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

Should we use signbit instead here (since, e.g. !(-0.0 < 0.0))? At least, this is what ForwardDiff's manual definition currently uses, though IIRC that decision was made fairly arbitrarily at the time...

Copy link
Member Author

Choose a reason for hiding this comment

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

That makes sense. Will make the change.

@willtebbutt
Copy link
Member Author

@jrevels requested changes made. Is there anything else you would like to happen prior to merging?

@jrevels
Copy link
Member

jrevels commented Mar 14, 2018

Nope, sorry for the delay. Thanks!

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