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

Conversion to Double #13

Closed
kewp opened this issue Mar 15, 2019 · 2 comments
Closed

Conversion to Double #13

kewp opened this issue Mar 15, 2019 · 2 comments

Comments

@kewp
Copy link

kewp commented Mar 15, 2019

I have a function which returns a var. How do I then do a calculation such as fabs(a-0.001)? I'm getting the error

error: cannot convert ‘autodiff::var’ to ‘double’ in assignment
@kewp
Copy link
Author

kewp commented Mar 15, 2019

I got it - val(a) :)

@kewp kewp closed this as completed Mar 15, 2019
@allanleal
Copy link
Member

Hmmm maybe ir makes sense to overload fabs (and also abs) in autodiff, so that you don't need to use val at all.

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

No branches or pull requests

2 participants