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

Substitute with fold=true does not preserve rationals #1299

Open
hersle opened this issue Oct 7, 2024 · 1 comment
Open

Substitute with fold=true does not preserve rationals #1299

hersle opened this issue Oct 7, 2024 · 1 comment

Comments

@hersle
Copy link
Contributor

hersle commented Oct 7, 2024

It is annoying that

@variables x
substitute(1//2 * cos(x), x => 0)

gives 0.5 and not 1//2.

The reason is natural: cos(0) evaluates to 1.0 (not 1), giving (1//2) * 1.0, which is converted to 0.5.
Is there a way to fix this?

@ChrisRackauckas
Copy link
Member

@shashi is this intended?

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